本文整理汇总了C#中TestClass.CleanAll方法的典型用法代码示例。如果您正苦于以下问题:C# TestClass.CleanAll方法的具体用法?C# TestClass.CleanAll怎么用?C# TestClass.CleanAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestClass
的用法示例。
在下文中一共展示了TestClass.CleanAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: test_child_dirty_tracking
public void test_child_dirty_tracking()
{
TestClass objTest = new TestClass();
Assert.IsFalse(objTest.IsAnythingDirty(), "Nothing in the object graph should be dirty.");
objTest.Child.ChildName = "test value";
Assert.IsTrue(objTest.IsAnythingDirty(), "The object graph should be dirty.");
objTest.CleanAll();
Assert.IsFalse(objTest.IsAnythingDirty(), "Nothing in the object graph should be dirty.");
}
示例2: test_dirty_object_aggregating
public void test_dirty_object_aggregating()
{
TestClass objTest = new TestClass();
List<IDirtyCapable> dirtyObjects = objTest.GetDirtyObjects();
Assert.IsTrue(dirtyObjects.Count == 0, "There should be no dirty object returned.");
objTest.Child.ChildName = "test value";
dirtyObjects = objTest.GetDirtyObjects();
Assert.IsTrue(dirtyObjects.Count == 1, "There should be one dirty object.");
objTest.DirtyProp = "test value";
dirtyObjects = objTest.GetDirtyObjects();
Assert.IsTrue(dirtyObjects.Count == 2, "There should be two dirty object.");
objTest.CleanAll();
dirtyObjects = objTest.GetDirtyObjects();
Assert.IsTrue(dirtyObjects.Count == 0, "There should be no dirty object returned.");
}