Exemplo n.º 1
0
 public void Run_Feature()
 {
     var messages = new StringWriter();
     var listener = new TextWriterEventListener(messages);
     TestFeatures.FeatureNamedStory.ExecuteFile(typeof(GreetingSystemActionSteps).Assembly, listener);
     _messages = messages.ToString();
 }
Exemplo n.º 2
0
        private NBehaveConfiguration CreateBasicConfiguration()
        {
            var writer = new StreamWriter(new MemoryStream());
            var listener = new TextWriterEventListener(writer);

            var config = ConfigurationNoAppDomain
                .New
                .SetAssemblies(new[] { "TestPlainTextAssembly.dll" })
                .SetEventListener(listener)
                .SetScenarioFiles(new[] { TestFeatures.FeatureWithManyScenarios });
            return config;
        }
Exemplo n.º 3
0
 public void Run_Feature()
 {
     var messages = new StringWriter();
     try
     {
         var listener = new TextWriterEventListener(messages);
         TestFeatures.FeatureWithFailingStep.ExecuteFile(typeof(GreetingSystemActionSteps).Assembly, listener);
     }
     catch (StepFailedException)
     {
     }
     finally
     {
         _messages = messages.ToString();
     }
 }
 private IRunner CreateTextRunner(IEnumerable<string> assemblies, string scenarioText)
 {
     var writer = new StreamWriter(new MemoryStream());
     var listener = new TextWriterEventListener(writer);
     return CreateTextRunner(assemblies, listener, scenarioText);
 }
Exemplo n.º 5
0
 public void Run_Feature()
 {
     var messages = new StringWriter();
     var listener = new TextWriterEventListener(messages);
     TestFeatures.FeatureWithPendingStep.ExecuteFile(listener);
     _messages = messages.ToString();
 }
Exemplo n.º 6
0
            public void SetUp()
            {
                _messages = new StringWriter();
                var listener = new TextWriterEventListener(_messages);

                _results = CreateBasicConfiguration()
                    .SetEventListener(listener)
                    .SetScenarioFiles(new[] { TestFeatures.FeatureNamedStory })
                    .Build()
                    .Run();
            }
Exemplo n.º 7
0
            public void ShouldMarkFailingStepAsFailedInOutput()
            {
                var writer = new StringWriter();
                var listener = new TextWriterEventListener(writer);
                CreateBasicConfiguration().SetEventListener(listener).SetScenarioFiles(new[] { TestFeatures.FeatureWithFailingStep })
                    .Build()
                    .Run();

                StringAssert.Contains("Then I should be greeted with “Hello, Scott!” - FAILED", writer.ToString());
            }