Beispiel #1
0
        public void Report(ScenarioReportingContext scenario)
        {
            // if this test isn't categorized into a feature bucket, don't output it!
            if (scenario.FeatureReport == null)
            {
                return;
            }

            var featureName = scenario.FeatureReport.Name;

            if (_featureState.ContainsKey(featureName))
            {
                using (var fs = File.Open(_featureState[featureName].Path, FileMode.Append, FileAccess.Write))
                {
                    using (var writer = new StreamWriter(fs))
                    {
                        writer.WriteLine(scenario.CreateReport(omitFeatureOutput: true));
                    }
                }
            }
            else
            {
                _featureState.Add(featureName, new
                {
                    Path = string.Format("{0}.feature", CoerceValidFileName(featureName))
                });
                using (var fs = File.Create(_featureState[featureName].Path))
                {
                    using (var writer = new StreamWriter(fs))
                    {
                        writer.WriteLine(scenario.CreateReport());
                    }
                }
            }
        }
Beispiel #2
0
 public void Report(ScenarioReportingContext scenario)
 {
     Trace.WriteLine(scenario.CreateReport());
 }
 public void Report(ScenarioReportingContext scenario)
 {
     ReportString += scenario.CreateReport();
 }