本文整理汇总了C#中FakeConnection.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# FakeConnection.Reset方法的具体用法?C# FakeConnection.Reset怎么用?C# FakeConnection.Reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FakeConnection
的用法示例。
在下文中一共展示了FakeConnection.Reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestInitialConnectionPromptsAfterEachWrite
public void TestInitialConnectionPromptsAfterEachWrite()
{
string endl = Environment.NewLine;
var connection = new FakeConnection();
var session = new Session(connection);
// Send a prompt through the connection. (This should be asking which character to login, or to create a new one.)
var prompt = session.State.BuildPrompt();
Verify.IsTrue(prompt.Length > 0);
Verify.AreEqual(1, connection.FakeMessagesSent.Count);
connection.Reset();
session.Write("test 1", true);
Verify.AreEqual(1, connection.FakeMessagesSent.Count);
Verify.AreEqual("test 1" + endl + prompt, connection.FakeMessagesSent[0]);
connection.Reset();
session.Write("test 2", false);
Verify.AreEqual(1, connection.FakeMessagesSent.Count);
Verify.AreEqual(endl + "test 2", connection.FakeMessagesSent[0]);
connection.Reset();
session.Write("test 3a");
session.Write("test 3b");
Verify.AreEqual(2, connection.FakeMessagesSent.Count);
Verify.AreEqual("test 3a" + endl + prompt, connection.FakeMessagesSent[0]);
Verify.AreEqual(endl + "test 3b" + endl + prompt, connection.FakeMessagesSent[1]);
}