public static string ReportOn(ScenarioResult result)
        {
            if (result.Passed) return "PASS";

            string summary = string.Format("{0} ran: {1} passed; {2} failed; {3} had errors",
                result.TotalCount, result.PassCount, result.FailureCount, result.ErrorCount);
            return result.Failed ? "FAILURE: " + summary : "ERROR: " + summary;
        }
Beispiel #2
0
        public ScenarioResult Test(RawTest[] rawTests, IResultsWriter resultsWriter)
        {
            var results = new ScenarioResult(name);
            resultsWriter.Begin(results);

            UserCache cache = new UserCache();
            foreach (RawTest rawTest in rawTests)
            {
                var realTest = rawTest.CreateRealTest(assemblies, cache);
                results.Add(realTest.Test(resultsWriter));
            }
            resultsWriter.End(results);
            return results;
        }
 public void End(ScenarioResult scenario)
 {
     writers.ForEach(writer => writer.End(scenario));
 }
 public void Begin(ScenarioResult scenario)
 {
     writers.ForEach(writer => writer.Begin(scenario));
 }
 public void Begin(ScenarioResult scenario)
 {
     currentScenario++;
     channel.Append(Format("scenario: {0} ({1} of {2}): ", scenario.ScenarioName, currentScenario, scenarioCount));
 }
        public void End(ScenarioResult scenario)
        {
            channel.AppendLine(": ");
            channel.Append("   ");

            if (scenario.Passed)
            {
                channel.AppendLine(ReportOn(scenario));
            }
            else if (scenario.Failed)
            {
                channel.AppendFailureLine(ReportOn(scenario));
            }
            else if (scenario.Errored)
            {
                channel.AppendErrorLine(ReportOn(scenario));
            }
        }
 public void End(ScenarioResult scenario)
 {
     // already ended
 }
 public void Begin(ScenarioResult scenario)
 {
     StartSpan("scenario");
     xmlWriter.WriteRaw("Scenario: " + scenario.ScenarioName);
     EndCurrentElement();
 }