public void Should_create_both_file_and_xml_listener_when_story_output_argument_and_xml_argument_passed_in() { var options = new ConsoleOptions { Parameters = new List <string> { "TestAssembly.dll" }, Xml = "XmlOutput2.txt", StoryOutput = "storiesTest.txt" }; EventListener listener = null; try { listener = NBehaveConsoleRunner.CreateEventListener(options); var multiOutputEventListener = (MultiOutputEventListener)listener; Assert.That(multiOutputEventListener.Listeners.Count(), Is.EqualTo(2)); } finally { if (listener != null) { listener.RunStarted(); listener.RunFinished(); } } }
public void Should_display_errormessage_if_assembly_doesnt_exist() { NBehaveConsoleRunner.Main(new[] { "IDontExist.dll", "/sf=*.scenario" }); Assert.That(_output.ToString(), Contains.Substring("File not found:")); // Assert.Contains("File not found: IDontExist.dll", _output.ToString()); // Assert.IsTrue(_output.ToString().Contains("File not found: IDontExist.dll")); }
public void Should_create_xml_listener_when_xml_argument_passed_in() { var options = new ConsoleOptions { Parameters = new List <string> { "TestAssembly.dll" }, Xml = "XmlOutput.txt" }; EventListener listener = null; try { listener = NBehaveConsoleRunner.CreateEventListener(options); var multiOutputEventListener = (MultiOutputEventListener)listener; Assert.That(multiOutputEventListener.Listeners[0], Is.TypeOf(typeof(XmlOutputEventListener))); } finally { if (listener != null) { listener.RunStarted(); listener.RunFinished(); } } }
public void Should_not_display_header_when_nologo_argument_set() { NBehaveConsoleRunner.Main(new[] { "TestAssembly.dll", "/nologo", "/sf=*.scenario" }); Assert.That(_output.ToString(), Is.Not.StringContaining("Copyright")); }
public void Should_run_example_framework_correctly() { NBehaveConsoleRunner.Main(new[] { "TestPlainTextAssembly.dll", "/sf=*.scenario" }); Assert.That(_output.ToString(), Does.Contain("Scenarios")); }