本文整理汇总了C#中Input.AdvanceAssert方法的典型用法代码示例。如果您正苦于以下问题:C# Input.AdvanceAssert方法的具体用法?C# Input.AdvanceAssert怎么用?C# Input.AdvanceAssert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Input
的用法示例。
在下文中一共展示了Input.AdvanceAssert方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LineCountingSmokeTest
public void LineCountingSmokeTest()
{
var i = new Input("abc\ndef");
Assert.AreEqual(0, i.Position);
Assert.AreEqual(1, i.Line);
Assert.AreEqual(1, i.Column);
i = i.AdvanceAssert((a, b) =>
{
Assert.AreEqual(1, b.Position);
Assert.AreEqual(1, b.Line);
Assert.AreEqual(2, b.Column);
});
i = i.AdvanceAssert((a, b) =>
{
Assert.AreEqual(2, b.Position);
Assert.AreEqual(1, b.Line);
Assert.AreEqual(3, b.Column);
});
i = i.AdvanceAssert((a, b) =>
{
Assert.AreEqual(3, b.Position);
Assert.AreEqual(1, b.Line);
Assert.AreEqual(4, b.Column);
});
i = i.AdvanceAssert((a, b) =>
{
Assert.AreEqual(4, b.Position);
Assert.AreEqual(2, b.Line);
Assert.AreEqual(1, b.Column);
});
i = i.AdvanceAssert((a, b) =>
{
Assert.AreEqual(5, b.Position);
Assert.AreEqual(2, b.Line);
Assert.AreEqual(2, b.Column);
});
i = i.AdvanceAssert((a, b) =>
{
Assert.AreEqual(6, b.Position);
Assert.AreEqual(2, b.Line);
Assert.AreEqual(3, b.Column);
});
}