Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan committed Jun 8, 2012
1 parent af352ae commit 4753399
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/shell.me/ShellMe.CommandLine.Tests/CommandInitTests.cs
Expand Up @@ -143,20 +143,20 @@ public void PrintsExceptionsToTheConsole()
[Test]
public void ReturnsLastCommandOnArrowUp()
{
var console = new TestConsole(new List<string>() { "test", "exit", "--test" });
var console = new TestConsole(new List<string>() { "test", "exit" });
var commandFactory = new CommandFactory(new[] { new TestCommand() });
var commandLoop = new CommandLoop(console, commandFactory);
commandLoop.Start(new[] { "test", "--IsTest" });
commandLoop.Start(new[] { "test" });

Assert.AreEqual("Run. Test: True, Text: ", console.OutputQueue[0]);
Assert.AreEqual("Run. Test: False, Text: ", console.OutputQueue[0]);
Assert.AreEqual("Enter commands or type exit to close", console.OutputQueue[1]);
Assert.AreEqual("Run. Test: False, Text: ", console.OutputQueue[2]);
Assert.AreEqual("Enter commands or type exit to close", console.OutputQueue[3]);
Assert.AreEqual(4, console.OutputQueue.Count);

commandLoop.Start(new[] { System.ConsoleKey.UpArrow.ToString() });

Assert.AreEqual("Run. Test: True, Text: ", console.OutputQueue[0]);
Assert.AreEqual("Run. Test: False, Text: ", console.OutputQueue[0]);
Assert.AreEqual("Enter commands or type exit to close", console.OutputQueue[1]);
Assert.AreEqual("Run. Test: False, Text: ", console.OutputQueue[2]);
Assert.AreEqual("Enter commands or type exit to close", console.OutputQueue[3]);
Expand Down
3 changes: 2 additions & 1 deletion src/shell.me/ShellMe.CommandLine/NativeConsoleWrapper.cs
Expand Up @@ -38,7 +38,8 @@ public string ReadLine()
}
else
{

Action action = CommandHistory.Matches[keyInfo.Key];
action.Invoke();
}
}
} while (Console.ReadKey(true).Key != ConsoleKey.Enter);
Expand Down

0 comments on commit 4753399

Please sign in to comment.