本文整理匯總了C#中Base.Clear方法的典型用法代碼示例。如果您正苦於以下問題:C# Base.Clear方法的具體用法?C# Base.Clear怎麽用?C# Base.Clear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Base
的用法示例。
在下文中一共展示了Base.Clear方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TestRunners
public static void TestRunners()
{
var b = new Base(null, string.Empty);
var a = new Base(b, string.Empty);
a.Land();
Assert.AreEqual(a.HasRunner, true);
Assert.AreEqual(b.HasRunner, false);
Assert.AreEqual(b.Advance(), false);
Assert.AreEqual(a.Advance(), true);
Assert.AreEqual(a.HasRunner, false);
Assert.AreEqual(b.HasRunner, true);
Assert.AreEqual(a.Advance(), false);
Assert.AreEqual(b.Advance(), true);
Assert.AreEqual(a.HasRunner, false);
Assert.AreEqual(b.HasRunner, false);
a.Error();
Assert.AreEqual(a.HasRunner, true);
Assert.AreEqual(b.HasRunner, false);
Assert.AreEqual(a.Out(), true);
Assert.AreEqual(a.Out(), false);
a.Land();
Assert.AreEqual(a.Out(), true);
Assert.AreEqual(a.Out(), false);
a.Land();
Assert.AreEqual(a.HasRunner, true);
Assert.AreEqual(b.HasRunner, false);
a.Clear();
Assert.AreEqual(a.HasRunner, false);
Assert.AreEqual(b.HasRunner, false);
}