public void TestEmpty() { DependencySystem <object> test = new DependencySystem <object>(); Assert.False(test.NeedsUpdate); CollectionAssert.IsEmpty(test.GetInvalidDependents()); }
public void TestSimpleUpdate() { DependencySystem<object> test = new DependencySystem<object>(); object a = 1; object b = 2; test.AddDependency(b, a); Assert.False(test.NeedsUpdate); test.Invalidate(a); List<DependencySystem<object>.InvalidDependent> updates = new List<DependencySystem<object>.InvalidDependent>(test.GetInvalidDependents()); Assert.AreEqual(updates.Count, 1); TestUpdate(updates[0], b, a); Assert.False(test.NeedsUpdate); }
public void TestUpdate() { DependencySystem<object> test = new DependencySystem<object>(); object a = 1; object b = 2; object c = 3; object d = 4; test.AddDependency(d, c); test.AddDependency(c, b); test.AddDependency(b, a); Assert.False(test.NeedsUpdate); test.Invalidate(a); List<DependencySystem<object>.InvalidDependent> updates = new List<DependencySystem<object>.InvalidDependent>(test.GetInvalidDependents()); Assert.AreEqual(updates.Count, 3); TestUpdate(updates[0], b, a); TestUpdate(updates[1], c, b); TestUpdate(updates[2], d, c); }
public void TestEmpty() { DependencySystem<object> test = new DependencySystem<object>(); Assert.False(test.NeedsUpdate); CollectionAssert.IsEmpty(test.GetInvalidDependents()); }
public void TestUpdate() { DependencySystem <object> test = new DependencySystem <object>(); object a = 1; object b = 2; object c = 3; object d = 4; test.AddDependency(d, c); test.AddDependency(c, b); test.AddDependency(b, a); Assert.False(test.NeedsUpdate); test.Invalidate(a); List <DependencySystem <object> .InvalidDependent> updates = new List <DependencySystem <object> .InvalidDependent>(test.GetInvalidDependents()); Assert.AreEqual(updates.Count, 3); TestUpdate(updates[0], b, a); TestUpdate(updates[1], c, b); TestUpdate(updates[2], d, c); }
public void TestSimpleUpdate() { DependencySystem <object> test = new DependencySystem <object>(); object a = 1; object b = 2; test.AddDependency(b, a); Assert.False(test.NeedsUpdate); test.Invalidate(a); List <DependencySystem <object> .InvalidDependent> updates = new List <DependencySystem <object> .InvalidDependent>(test.GetInvalidDependents()); Assert.AreEqual(updates.Count, 1); TestUpdate(updates[0], b, a); Assert.False(test.NeedsUpdate); }