Permalink
Browse files

small fix

  • Loading branch information...
1 parent af352ae commit 4753399b022df2a0dbd521d49f49d8a6d74672b4 Stephan committed Jun 8, 2012
View
8 src/shell.me/ShellMe.CommandLine.Tests/CommandInitTests.cs
@@ -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]);
View
3 src/shell.me/ShellMe.CommandLine/NativeConsoleWrapper.cs
@@ -38,7 +38,8 @@ public string ReadLine()
}
else
{
-
+ Action action = CommandHistory.Matches[keyInfo.Key];
+ action.Invoke();
}
}
} while (Console.ReadKey(true).Key != ConsoleKey.Enter);

0 comments on commit 4753399

Please sign in to comment.