public void TestAddOrUpdate()
        {
            var sut = new ConcurrentDictionaryExample();

            sut.AddOrUpdate();
            Assert.AreEqual(12, sut.Result);
        }
        public void TestGetOrAdd()
        {
            var sut = new ConcurrentDictionaryExample();

            sut.GetOrAdd();
            Assert.AreEqual(12, sut.Result);
        }
        public void TestTryAddUpdate()
        {
            var sut = new ConcurrentDictionaryExample();

            sut.Run();
            Assert.AreEqual(285, sut.Result);
        }
Exemplo n.º 4
0
        async static Task Main(string[] args)
        {
            await GenericDictionaryExample.ExecuteAsync();

            await ConcurrentDictionaryExample.ExecuteAsync();

            Console.ReadKey();
        }