public void Run_Feature()
 {
     var messages = new StringWriter();
     var listener = new TextWriterEventListener(messages);
     TestFeatures.FeatureNamedStory.ExecuteFile(typeof(GreetingSystemActionSteps).Assembly, listener);
     _messages = messages.ToString();
 }
Exemple #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;
        }
 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);
 }
 public void Run_Feature()
 {
     var messages = new StringWriter();
     var listener = new TextWriterEventListener(messages);
     TestFeatures.FeatureWithPendingStep.ExecuteFile(listener);
     _messages = messages.ToString();
 }
Exemple #6
0
            public void SetUp()
            {
                _messages = new StringWriter();
                var listener = new TextWriterEventListener(_messages);

                _results = CreateBasicConfiguration()
                    .SetEventListener(listener)
                    .SetScenarioFiles(new[] { TestFeatures.FeatureNamedStory })
                    .Build()
                    .Run();
            }
Exemple #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());
            }