/// <summary> /// Reads data from MBBSEMU until endingCharacter is received, and also verifies the /// last data read contains message. /// </summary> protected string WaitUntil(char endingCharacter, string message) { string line; while (true) { line = _session.GetLine(endingCharacter, TimeSpan.FromSeconds(2)); if (line.Contains(message)) { return(line); } } }
/// <summary> /// Reads data from MBBSEMU until endingCharacter is received, and also verifies the /// last data read contains message. /// <returns>All the lines delineated by endingCharacter until message is found</returns> /// </summary> protected List <string> WaitUntil(char endingCharacter, string message) { var lines = new List <string>(); while (true) { var line = _session.GetLine(endingCharacter, TimeSpan.FromSeconds(2)); lines.Add(line); if (line.Contains(message)) { return(lines); } } }
public void normalBreaks() { testSession.WordWrapWidth = 80; testSession.SendToClient("Testing one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen\r\n"); testSession.GetLine(TimeSpan.FromMilliseconds(100)).Should().Be("Testing one two three four five six seven eight nine ten eleven twelve thirteen"); testSession.GetLine(TimeSpan.FromMilliseconds(100)).Should().Be("fourteen fifteen sixteen"); }