コード例 #1
0
ファイル: IReportTarget.cs プロジェクト: windhandel/Kekiri
 public void Report(ScenarioReportingContext scenario)
 {
     foreach (var target in _targets)
     {
         target.Report(scenario);
     }
 }
コード例 #2
0
ファイル: IReportTarget.cs プロジェクト: windhandel/Kekiri
        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());
                    }
                }
            }
        }
コード例 #3
0
ファイル: IReportTarget.cs プロジェクト: kevintavog/Kekiri
        public void Report(ReportType reportType, ScenarioReportingContext reportingContext)
        {
            // only output current test info if running in R# -- it's not useful in command line builds
            if (reportType == ReportType.CurrentTest)
            {
                var executingProcessName = Process.GetCurrentProcess().ProcessName;

                if (executingProcessName.IndexOf("JetBrains.ReSharper", StringComparison.InvariantCultureIgnoreCase) == -1)
                {
                    return;
                }
            }

            int indentationLevel = 0;
            // avoid repeating the same feature over and over
            var featureKey = GetKey(reportingContext.FeatureReport);
            if (featureKey != null && featureKey == _previousFeatureKey)
            {
                indentationLevel = 1;
                reportingContext.FeatureReport.Clear();
            }

            Trace.WriteLine(reportingContext.CreateReportWithStandardSpacing(indentationLevel));

            _previousFeatureKey = featureKey;
        }
コード例 #4
0
        public void Report(ReportType reportType, ScenarioReportingContext reportingContext)
        {
            // only output current test info if running in R# -- it's not useful in command line builds
            if (reportType == ReportType.CurrentTest)
            {
                var executingProcessName = Process.GetCurrentProcess().ProcessName;

                if (executingProcessName.IndexOf("JetBrains.ReSharper", StringComparison.InvariantCultureIgnoreCase) == -1)
                {
                    return;
                }
            }

            int indentationLevel = 0;
            // avoid repeating the same feature over and over
            var featureKey = GetKey(reportingContext.FeatureReport);

            if (featureKey != null && featureKey == _previousFeatureKey)
            {
                indentationLevel = 1;
                reportingContext.FeatureReport.Clear();
            }

            Trace.WriteLine(reportingContext.CreateReportWithStandardSpacing(indentationLevel));

            _previousFeatureKey = featureKey;
        }
コード例 #5
0
ファイル: IReportTarget.cs プロジェクト: windhandel/Kekiri
 public void Report(ScenarioReportingContext scenario)
 {
     Trace.WriteLine(scenario.CreateReport());
 }
コード例 #6
0
ファイル: CountingReportTarget.cs プロジェクト: kcamp/Kekiri
 public void Report(ScenarioReportingContext scenario)
 {
     WriteCount++;
 }
コード例 #7
0
 public void Report(ScenarioReportingContext scenario)
 {
     ReportString += scenario.CreateReport();
 }
コード例 #8
0
 public void Report(ReportType reportType, ScenarioReportingContext reportingContext)
 {
     ReportString += reportingContext.CreateReportWithStandardSpacing(0);
 }
コード例 #9
0
 public void Report(ReportType reportType, ScenarioReportingContext reportingContext)
 {
     WriteCount++;
 }