Пример #1
0
        private void SetAndTest(ThreadClass1 testClass, int value)
        {
            testClass.Property1 = value;

            Assert.True(testClass.IsModified());
            Assert.Equal(value, testClass.Property1);
        }
Пример #2
0
        private void SetAndTest(ThreadClass1 testClass, int value)
        {
            testClass.Property1 = value;

            Assert.True(testClass.IsModified());
            Assert.Equal(value, testClass.Property1);
        }
Пример #3
0
        public void TestRaces()
        {
            var testClass = new ThreadClass1();
            testClass.Save();
            var id = testClass.Id();

            Parallel.For(0, 10, i =>
            {
                var test = Modl<ThreadClass1>.Get(id);
                SetAndTest(test, 100);
                SetAndTest(test, 200);
                SetAndTest(test, 300);
                SetAndTest(test, 400);
                SetAndTest(test, 500);
            });
        }
Пример #4
0
        public void TestRaces()
        {
            var testClass = new ThreadClass1();

            testClass.Save();
            var id = testClass.Id();

            Parallel.For(0, 10, i =>
            {
                var test = Modl <ThreadClass1> .Get(id);
                SetAndTest(test, 100);
                SetAndTest(test, 200);
                SetAndTest(test, 300);
                SetAndTest(test, 400);
                SetAndTest(test, 500);
            });
        }