private void SetAndTest(ThreadClass1 testClass, int value) { testClass.Property1 = value; Assert.True(testClass.IsModified()); Assert.Equal(value, testClass.Property1); }
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); }); }
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); }); }