예제 #1
0
        private void CreatePendingSteps(EventReceived evt, ScenarioResult scenarioResult)
        {
            var actionSteps = from e in EventsOf(evt, EventType.ScenarioResult)
                              where e.EventType == EventType.ScenarioStart
                              select e;

            foreach (var step in actionSteps)
            {
                scenarioResult.AddActionStepResult(new StepResult(new StringStep(step.Message, "lost it"), new Pending(scenarioResult.Message)));
            }
        }
예제 #2
0
        public void DoFeature(EventReceived evt)
        {
            var events = EventsOf(evt, EventType.FeatureStart);
            var featureTitle = evt.Message;
            WriteStartElement("feature", featureTitle, events.Last().Time.Subtract(events.First().Time));
            var scenarioResultsForFeature = GetScenarioResultsForFeature(featureTitle, events);

            WriteStoryDataAttributes(scenarioResultsForFeature);
            WriteStoryNarrative(events);
            WriteBackgroundEvents(events);
            WriteScenarioEvents(scenarioResultsForFeature, featureTitle, events);
            Writer.WriteEndElement();
        }
예제 #3
0
        public void DoFeature(EventReceived evt)
        {
            var events       = EventsOf(evt, EventType.FeatureStart);
            var featureTitle = evt.Message;

            WriteStartElement("feature", featureTitle, events.Last().Time.Subtract(events.First().Time));
            var scenarioResultsForFeature = GetScenarioResultsForFeature(featureTitle, events);

            WriteStoryDataAttributes(scenarioResultsForFeature);
            WriteStoryNarrative(events);
            WriteBackgroundEvents(events);
            WriteScenarioEvents(scenarioResultsForFeature, featureTitle, events);
            Writer.WriteEndElement();
        }
예제 #4
0
        private IEnumerable <EventReceived> EventsOf(EventReceived startEvent, EventType endWithEvent)
        {
            var idxStart = EventsReceived.IndexOf(startEvent);
            var idxEnd   = idxStart;
            var events   = new List <EventReceived>();

            do
            {
                events.Add(EventsReceived[idxEnd]);
                idxEnd++;
            }while (idxEnd < EventsReceived.Count && EventsReceived[idxEnd].EventType != endWithEvent);
            if (idxEnd < EventsReceived.Count)
            {
                events.Add(EventsReceived[idxEnd]);
            }

            return(events);
        }
예제 #5
0
        public void DoScenario(EventReceived evt, ScenarioResult scenarioResult)
        {
            var events = from e in EventsOf(evt, EventType.ScenarioStart)
                         where e.EventType == EventType.ScenarioStart
                         select e;
            WriteStartElement("scenario", evt.Message, events.Last().Time.Subtract(events.First().Time));

            Writer.WriteAttributeString("outcome", scenarioResult.Result.ToString());

            if (IsPendingAndNoActionStepsResults(scenarioResult))
                CreatePendingSteps(evt, scenarioResult);

            foreach (var step in scenarioResult.StepResults)
                DoStringStep(step);

            DoExamplesInScenario(scenarioResult as ScenarioExampleResult);
            Writer.WriteEndElement();
        }
예제 #6
0
        public void DoScenario(EventReceived evt, ScenarioResult scenarioResult)
        {
            var events = from e in EventsOf(evt, EventType.ScenarioStart)
                         where e.EventType == EventType.ScenarioStart
                         select e;

            WriteStartElement("scenario", evt.Message, events.Last().Time.Subtract(events.First().Time));

            Writer.WriteAttributeString("outcome", scenarioResult.Result.ToString());

            if (IsPendingAndNoActionStepsResults(scenarioResult))
            {
                CreatePendingSteps(evt, scenarioResult);
            }

            foreach (var step in scenarioResult.StepResults)
            {
                DoStringStep(step);
            }

            DoExamplesInScenario(scenarioResult as ScenarioExampleResult);
            Writer.WriteEndElement();
        }
예제 #7
0
        private IEnumerable<EventReceived> EventsOf(EventReceived startEvent, EventType endWithEvent)
        {
            var idxStart = EventsReceived.IndexOf(startEvent);
            var idxEnd = idxStart;
            var events = new List<EventReceived>();
            do
            {
                events.Add(EventsReceived[idxEnd]);
                idxEnd++;
            }
            while (idxEnd < EventsReceived.Count && EventsReceived[idxEnd].EventType != endWithEvent);
            if (idxEnd < EventsReceived.Count)
            {
                events.Add(EventsReceived[idxEnd]);
            }

            return events;
        }
예제 #8
0
 private void CreatePendingSteps(EventReceived evt, ScenarioResult scenarioResult)
 {
     var actionSteps = from e in EventsOf(evt, EventType.ScenarioResult)
                       where e.EventType == EventType.ScenarioStart
                       select e;
     foreach (var step in actionSteps)
         scenarioResult.AddActionStepResult(new StepResult(new StringStep(step.Message, "lost it"), new Pending(scenarioResult.Message)));
 }