Beispiel #1
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("FeatureTitle", EventType.FeatureStart),
                    new EventReceived("As a x\nI want y\nSo That z", EventType.FeatureNarrative),
                    new EventReceived("ScenarioTitle", EventType.ScenarioStart),
                    new ScenarioResultEventReceived(scenarioResult)
                };

                xmlOutputWriter = new XmlOutputWriter(xmlWriter, eventsReceived);
                xmlOutputWriter.DoFeature(eventsReceived[0]);
                xmlWriter.Flush();
                xmlDoc = new XmlDocument();
                memStream.Seek(0, SeekOrigin.Begin);
                xmlDoc.Load(memStream);
            }
Beispiel #2
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);
            }
Beispiel #3
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);
            }
Beispiel #4
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);
        }