public void TestSignle() { string message = ""; Regulus.Utility.KeyReader reader = new Regulus.Utility.KeyReader('\r'); reader.DoneEvent += (chars) => { message = new string(chars); }; reader.Push('a'); reader.Push('b'); reader.Push('\r'); Assert.AreEqual("ab", message); }
public void TestMuti() { string message = ""; Regulus.Utility.KeyReader reader = new Regulus.Utility.KeyReader('\r'); reader.DoneEvent += (chars) => { message = new string(chars); }; reader.Push(new char[] { 'a', 'b', '\r' }); Assert.AreEqual("ab", message); }