Пример #1
0
        public void Run_Given_ClassWithArrayConcurrencyIssues_With_DoNotChangePropertyOnChildArray_Should_ThrowConcurrencyException()
        {
            var instance = new ClassWithArrayConcurrencyIssues();

            var finder = new ConcurrencyChecker(instance, null, 2000);

            var error = Assert.Throws <ConcurrencyException>(() => finder.Assert(2000, () => { instance.Names[0] = "Jane"; },
                                                                                 () => { instance.Names[0] = "Dave"; }));

            Console.WriteLine(error.Message);
        }
Пример #2
0
        public void Run_Given_ClassWithArrayConcurrencyIssues_With_ChangePropertyOnChildArray_Should_Succeed()
        {
            var instance = new ClassWithArrayConcurrencyIssues();

            var finder = new ConcurrencyChecker(instance, null, 2000);

            finder.Assert(600, () => { instance.Names[0] = "Jane"; },
                          () =>
            {
                var name = instance.Names[0];
            });
        }