public void Match_NoMatchingArgument_PrintsUsageMessageIfHelpCommandIsMissing() { var sut = new SimpleConsoleApp(); sut.Main(new[] { "-NoMatchingArg" }); StringAssert.Contains("Using: consolas", ConsoleOut.ToString()); }
public void Match_ExplicitDefaultArguments_EndToEndTest() { var sut = new SimpleConsoleApp(); sut.Main(new[] {"-DefaultProperty1", "foo", "-DefaultProperty2", "bar"}); StringAssert.Contains("foo", ConsoleOut.ToString()); StringAssert.Contains("bar", ConsoleOut.ToString()); }
public void Match_FullFilePath_EndToEndTest() { var sut = new SimpleConsoleApp(); sut.Main(new[] { @"C:\fullpath\foo.txt" }); StringAssert.Contains("DefaultCommand", ConsoleOut.ToString()); }
public void Match_EndToEndTest() { var sut = new SimpleConsoleApp(); sut.Main(new[] { "-Parameter", "foo" }); StringAssert.Contains("SimpleCommand", ConsoleOut.ToString()); }
public void Match_ConflictingArgs_EndToEndTest(string[] args, string expected) { var sut = new SimpleConsoleApp(); sut.Main(args); StringAssert.Contains(expected, ConsoleOut.ToString()); }
public void Match_MultipleExecutes_EndToEndTest2() { var sut = new SimpleConsoleApp(); sut.Main(new[] { "-MultipleExecute2" }); StringAssert.Contains("Execute 2", ConsoleOut.ToString()); }
public void Match_ExplicitDefaultArguments_EndToEndTest() { var sut = new SimpleConsoleApp(); sut.Main(new[] { "-DefaultProperty1", "foo", "-DefaultProperty2", "bar" }); StringAssert.Contains("foo", ConsoleOut.ToString()); StringAssert.Contains("bar", ConsoleOut.ToString()); }
public void Match_ImplicitDefaultArguments_EndToEndTest() { var sut = new SimpleConsoleApp(); sut.Main(new[] {"foo", "bar"}); StringAssert.Contains("foo", ConsoleOut.ToString()); StringAssert.Contains("bar", ConsoleOut.ToString()); StringAssert.Contains("DefaultCommand", ConsoleOut.ToString()); }
public void Match_ArgumentWithoutCommand_ThrowsException() { var sut = new SimpleConsoleApp(); Action match = () => sut.Main(new[] { "-ArgWithoutCommand", "foo" }); match.ShouldThrow <NotImplementedException>(); }
public void Match_CommandWhichThrowsException_SameExceptionIsRethrown() { var sut = new SimpleConsoleApp(); Action match = () => sut.Main(new[] { "-Throw" }); match.ShouldThrow <Exception>(); }
public void Match_ConflictingArgs_EndToEndTest(string[] args, string expected) { var sut = new SimpleConsoleApp(); sut.Main(args); StringAssert.Contains(expected, ConsoleOut.ToString()); }
public void Match_CommandWhichThrowsException_SameExceptionIsRethrown() { var sut = new SimpleConsoleApp(); Action match = () => sut.Main(new[] {"-Throw"}); match.ShouldThrow<Exception>(); }
public void Match_ArgumentWithoutCommand_ThrowsException() { var sut = new SimpleConsoleApp(); Action match = () => sut.Main(new[] {"-ArgWithoutCommand", "foo"}); match.ShouldThrow<NotImplementedException>(); }
public void Match_RenderNoViewEngines_ThrowsException() { var sut = new SimpleConsoleApp(); Action match = () => sut.Main(new [] { "-RenderView" }); match.ShouldThrow <ViewEngineException>(ex => StringAssert.Contains("No view engines", ex.Message)); }
public void Match_ImplicitDefaultArguments_EndToEndTest() { var sut = new SimpleConsoleApp(); sut.Main(new[] { "foo", "bar" }); StringAssert.Contains("foo", ConsoleOut.ToString()); StringAssert.Contains("bar", ConsoleOut.ToString()); StringAssert.Contains("DefaultCommand", ConsoleOut.ToString()); }
public void Match_ConflictingNonDeterministicArgs_EndToEndTest() { var sut = new SimpleConsoleApp(); sut.Main(new[] { "-Arg" }); string output = ConsoleOut.ToString(); // Should print exception message StringAssert.Contains("non deterministic", output); // Should print the usage msg or default view! StringAssert.Contains("Using:", output); }
public void Match_ConflictingNonDeterministicArgs_EndToEndTest() { var sut = new SimpleConsoleApp(); sut.Main(new[] { "-Arg" }); string output = ConsoleOut.ToString(); // Should print exception message StringAssert.Contains("non deterministic", output); // Should print the usage msg or default view! StringAssert.Contains("Using:", output); }
public void Match_NoMatchingArgument_PrintsUsageMessageIfHelpCommandIsMissing() { var sut = new SimpleConsoleApp(); sut.Main(new[] {"-NoMatchingArg"}); StringAssert.Contains("Using: consolas", ConsoleOut.ToString()); }
public void Match_EndToEndTest() { var sut = new SimpleConsoleApp(); sut.Main(new[] {"-Parameter", "foo"}); StringAssert.Contains("SimpleCommand", ConsoleOut.ToString()); }
public void Match_MultipleExecutes_EndToEndTest1() { var sut = new SimpleConsoleApp(); sut.Main(new[] {"-MultipleExecute1"}); StringAssert.Contains("Execute 1", ConsoleOut.ToString()); }
public void Match_ViewNoViewEngines_ThrowsException() { var sut = new SimpleConsoleApp(); Action match = () => sut.Main(new[] { "-ShowView" }); match.ShouldThrow<ViewEngineException>(ex => StringAssert.Contains("No view engines", ex.Message)); }