public void TestReport() { var reporter = new StatusReporter(); for (var i = 0; i < 32; i++) { reporter.RecordUnique(); } for (var i = 0; i < 4; i++) { reporter.RecordDuplicate(); } using (var writer = new StringWriter()) { reporter.Report(writer); Assert.Equal( "Received 32 unique numbers, 4 duplicates. Unique total: 32", writer.ToString()); } Assert.Equal(32, reporter.TotalUnique); Assert.Equal(4, reporter.TotalDuplicates); Assert.Equal(0, reporter.IncrementalUnique); Assert.Equal(0, reporter.IncrementalDuplicates); for (var i = 0; i < 31; i++) { reporter.RecordUnique(); } for (var i = 0; i < 3; i++) { reporter.RecordDuplicate(); } using (var writer = new StringWriter()) { reporter.Report(writer); Assert.Equal( "Received 31 unique numbers, 3 duplicates. Unique total: 63", writer.ToString()); } Assert.Equal(63, reporter.TotalUnique); Assert.Equal(7, reporter.TotalDuplicates); Assert.Equal(0, reporter.IncrementalUnique); Assert.Equal(0, reporter.IncrementalDuplicates); }
public void should_gatter_information_from_all_the_reporters() { var report1 = "This is the random report 1"; var report2 = "This is the random report 2"; _randomReporter1.Report().Returns(report1); _randomReporter2.Report().Returns(report2); var report = _statusReporter.Report(); report.Should().Contain(report1); report.Should().Contain(report2); }
public void should_get_how_many_ants_are_alive() { _reporter.Report(); _colony.Received(1).GetAnts(); }
public void should_get_how_many_ants_are_dead() { _reporter.Report(); _cemetery.Received(1).GetCorpses(); }
public void should_get_how_many_eggs_are_incubating() { _reporter.Report(); _eggsChecker.Received(1).CheckEggs(); }