public void ShouldSerializeDiagnosticDataToSpecifiedFormat() { var serializer = Substitute.For <ISerializer>(); var testData = new ReportTestData().CreateTwoStoriesEachWithTwoScenariosWithThreeStepsOfFiveMilliseconds(); var model = new FileReportModel(testData); var sut = new DiagnosticsReportBuilder(serializer); sut.CreateReport(model); serializer.Received().Serialize(Arg.Any <object>()); }
public void ShouldSerializeDiagnosticDataToSpecifiedFormat() { var serializer = Substitute.For<ISerializer>(); var testData = new ReportTestData().CreateTwoStoriesEachWithTwoScenariosWithThreeStepsOfFiveMilliseconds(); var model = new FileReportModel(testData); var sut = new DiagnosticsReportBuilder(serializer); sut.CreateReport(model); serializer.Received().Serialize(Arg.Any<object>()); }
public void ShouldProduceExpectedHtmlWithExamples() { var reportData = new ReportTestData().CreateTwoStoriesEachWithOneFailingScenarioAndOnePassingScenarioWithThreeStepsOfFiveMillisecondsAndEachHasTwoExamples().ToReportModel(); var model = new HtmlReportModel(reportData) { RunDate = new DateTime(2014, 3, 25, 11, 30, 5) }; var sut = new ClassicReportBuilder(); ReportApprover.Approve(model, sut); }
public void ShouldProduceExpectedTextWithExamples() { var stories = new ReportTestData().CreateTwoStoriesEachWithOneFailingScenarioAndOnePassingScenarioWithThreeStepsOfFiveMillisecondsAndEachHasTwoExamples(); var actual = new StringBuilder(); foreach (var story in stories) { var textReporter = new TextReporter(); textReporter.Process(story); actual.AppendLine(textReporter.ToString()); } Approvals.Verify(actual.ToString(), StackTraceScrubber.ScrubStackTrace); }
public void ShouldProduceExpectedReport() { var stories = new ReportTestData().CreateMixContainingEachTypeOfOutcomeWithOneScenarioPerStory(); var actual = new StringBuilder(); foreach (var story in stories) { var textReporter = new TextReporter(); textReporter.Process(story); actual.AppendLine(textReporter.ToString()); } Approvals.Verify(actual.ToString(), StackTraceScrubber.ScrubStackTrace); }
public void ShouldProduceExpectedTextWithExamples() { var stories = new ReportTestData().CreateTwoStoriesEachWithOneFailingScenarioAndOnePassingScenarioWithThreeStepsOfFiveMillisecondsAndEachHasTwoExamples(); var actual = new StringBuilder(); foreach (var story in stories) { var textReporter = new TextReporter(); textReporter.Process(story); actual.AppendLine(textReporter.ToString()); } Approvals.Verify(actual.ToString(), StackTraceScrubber.Scrub); }
public void ShouldProduceExpectedReport() { var stories = new ReportTestData().CreateMixContainingEachTypeOfOutcomeWithOneScenarioPerStory(); var actual = new StringBuilder(); foreach (var story in stories) { var textReporter = new TextReporter(); textReporter.Process(story); actual.AppendLine(textReporter.ToString()); } Approvals.Verify(actual.ToString(), StackTraceScrubber.Scrub); }
public void ShouldProduceExpectedReport() { var stories = new ReportTestData().CreateMixContainingEachTypeOfOutcomeWithOneScenarioPerStory(); var actual = new StringBuilder(); foreach (var story in stories) { var textReporter = new TextReporter(); textReporter.Process(story); actual.AppendLine(textReporter.ToString()); } actual.ToString().ShouldMatchApproved(c => c.WithScrubber(ReportApprover.Scrub)); }