public override string Report() { var corpses = _cemeteryRepository.GetCorpses(); var cemeteryReport = string.Join("; ", corpses.Select(s => s.ToString())); if (string.IsNullOrWhiteSpace(cemeteryReport)) { cemeteryReport = "There are no dead ants"; } return($"Dead Ants: {cemeteryReport}"); }
public void should_report_how_many_ants_are_dead() { _cemetery.GetCorpses().Returns(new List <CorpsesDTO>() { new CorpsesDTO("Warrior", 5), new CorpsesDTO("Workers", 10) }); var report = _reporter.Report(); report.Should().Contain("5"); report.Should().Contain("10"); report.Should().Contain("Warrior"); report.Should().Contain("Workers"); }
public void should_get_all_dead_ants_corpses() { _cemetery.GetCorpses(); _corpseGetter.Received(1).Get(); }