public override string Report() { var ants = _colony.GetAnts(); var livingAntsReport = string.Join("; ", ants.Select(s => s.ToString())); if (string.IsNullOrWhiteSpace(livingAntsReport)) { livingAntsReport = "There are no ants in the colony"; } return($"Living Ants: {livingAntsReport}"); }
public void should_report_how_many_ants_are_alive() { _colony.GetAnts().Returns(new List <AntsDTO>() { new AntsDTO("Warrior", 5), new AntsDTO("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_living_ants() { _colony.GetAnts(); _antsGetter.Received(1).Get(); }