InputCommandTest.cs


 using System; 
using NUnit.Framework;
using System.IO;
namespace Notepad
{
[TestFixture] public class InputCommandTest : Assertion
{
private InputCommand command;
[Test] public void EmptyCommand() {
command = new InputCommand(new StringReader(""));
AssertEquals(0, command.CleanLines().Count);
}
[Test] public void OneLineCommand() {
String oneLineString =
@"one line
*end";
StringReader reader = new StringReader(oneLineString);
command = new InputCommand(reader);
AssertEquals(1, command.CleanLines().Count);
AssertEquals(8,command.SelectionStart());
}
[Test] public void OneDirtyLine() {
command = new InputCommand(new StringReader("ab\n*end"));
AssertEquals("ab", command.CleanLines()[0]);
AssertEquals(1,command.SelectionStart());
}
}
}



Extreme Programming Adventures in C#
Javaв„ў EE 5 Tutorial, The (3rd Edition)
ISBN: 735619492
EAN: 2147483647
Year: 2006
Pages: 291

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net