Esempio n. 1
0
 protected override void EstablishContext()
 {
     var memStream = new MemoryStream();
     var xmlWriter = new XmlTextWriter(memStream, Encoding.UTF8);
     _xmlOutputWriter = new XmlOutputWriter(xmlWriter, new List<EventReceived>());
     var result = new StepResult(Step("Given Foo"), Passed);
     _xmlOutputWriter.DoStringStep(result);
     xmlWriter.Flush();
     _xmlDoc = new XmlDocument();
     memStream.Seek(0, SeekOrigin.Begin);
     _xmlDoc.Load(memStream);
 }
Esempio n. 2
0
        protected virtual void EstablishContext()
        {
            var memStream = new MemoryStream();
            var xmlWriter = new XmlTextWriter(memStream, Encoding.UTF8);

            var story = new Feature("StoryTitle");
            var scenarioResult = new ScenarioResult(story, "ScenarioTitle");
            var actionStepResult = new StepResult(Step("Given Foo"), Passed);
            scenarioResult.AddActionStepResult(actionStepResult);

            var eventsReceived = new List<EventReceived>
                                     {
                                         new EventReceived("", EventType.RunStart),
                                         new EventReceived("StoryTitle", EventType.FeatureStart),
                                         new EventReceived("As a x\nI want y\nSo That z", EventType.FeatureNarrative),
                                         new EventReceived("ScenarioTitle", EventType.ScenarioStart),
                                         new ScenarioResultEventReceived(scenarioResult),
                                         new EventReceived("", EventType.FeatureFinished),
                                         new EventReceived("", EventType.RunFinished)
                                     };

            _xmlOutputWriter = new XmlOutputWriter(xmlWriter, eventsReceived);
        }
 public XmlOutputEventListener(XmlWriter writer)
 {
     Writer = writer;
     xmlOutputWriter = new XmlOutputWriter(Writer, eventsReceived);
 }
Esempio n. 4
0
            protected override void EstablishContext()
            {
                var memStream = new MemoryStream();
                var xmlWriter = new XmlTextWriter(memStream, Encoding.UTF8);

                var eventsReceived = new List<EventReceived>
                                        {
                                            new EventReceived("", EventType.RunStart),
                                        };
                eventsReceived.AddRange(CreateFirstFeature());
                eventsReceived.AddRange(CreateSecondFeature());
                eventsReceived.Add(new EventReceived("", EventType.RunFinished));
                _xmlOutputWriter = new XmlOutputWriter(xmlWriter, eventsReceived);
                _xmlOutputWriter.WriteAllXml();
                xmlWriter.Flush();
                _xmlDoc = new XmlDocument();
                memStream.Seek(0, SeekOrigin.Begin);
                _xmlDoc.Load(memStream);
            }
Esempio n. 5
0
            protected override void EstablishContext()
            {
                var memStream = new MemoryStream();
                var xmlWriter = new XmlTextWriter(memStream, Encoding.UTF8);

                var feature = new Feature("FeatureTitle");
                var scenarioResult = new ScenarioResult(feature, "ScenarioTitle");
                var actionStepResult1 = new StepResult(Step("Given a"), Passed);
                scenarioResult.AddActionStepResult(actionStepResult1);
                var actionStepResult2 = new StepResult(Step("When b"), Passed);
                scenarioResult.AddActionStepResult(actionStepResult2);
                var actionStepResult3 = new StepResult(Step("Then c"), Passed);
                scenarioResult.AddActionStepResult(actionStepResult3);

                var eventsReceived = new List<EventReceived>
                                         {
                                             new EventReceived("ScenarioTitle", EventType.ScenarioStart),
                                             new ScenarioResultEventReceived(scenarioResult)
                                         };

                _xmlOutputWriter = new XmlOutputWriter(xmlWriter, eventsReceived);
                _xmlOutputWriter.DoScenario(eventsReceived[0], scenarioResult);
                xmlWriter.Flush();
                _xmlDoc = new XmlDocument();
                memStream.Seek(0, SeekOrigin.Begin);
                _xmlDoc.Load(memStream);
            }
Esempio n. 6
0
 public XmlOutputEventListener(XmlWriter writer)
 {
     Writer          = writer;
     xmlOutputWriter = new XmlOutputWriter(Writer, eventsReceived);
 }