public void OneLineCommand() { String oneLineString = "one line\n*end"; StringReader reader = new StringReader(oneLineString); command = new InputCommand(reader); Assert.AreEqual(1, command.CleanLines().Count); Assert.AreEqual(8, command.SelectionStart()); }
public void OneDirtyLine() { command = new InputCommand(new StringReader("a|b\n*end")); Assert.AreEqual("ab", command.CleanLines()[0]); Assert.AreEqual(1, command.SelectionStart()); }
private void SetInput(StringReader reader) { InputCommand input = new InputCommand(reader); form.TextModel.Lines = input.CleanLines(); form.TextModel.SelectionStart = input.SelectionStart(); form.PutText(null, (String[]) form.TextModel.Lines.ToArray(typeof(String)), form.TextModel.SelectionStart); }