示例#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
        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);
        }
示例#4
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();
        }