public override string Report()
        {
            var eggs = _eggsChecker.CheckEggs();

            var eggsReport = string.Join("; ", eggs.Select(s => s.ToString()));

            if (string.IsNullOrWhiteSpace(eggsReport))
            {
                eggsReport = "There are no eggs incubating";
            }

            return($"Eggs Incubating: {eggsReport}");
        }
Esempio n. 2
0
        public void should_report_how_many_eggs_are_incubating()
        {
            _eggsChecker.CheckEggs().Returns(new List <EggsDTO>()
            {
                new EggsDTO("Warrior", 5), new EggsDTO("Worker", 10)
            });

            var report = _reporter.Report();

            report.Should().Contain("5");
            report.Should().Contain("10");
            report.Should().Contain("Warrior");
            report.Should().Contain("Worker");
        }
        public void should_check_all_eggs_incubating()
        {
            _checker.CheckEggs();

            _incubator.Received(1).GetEggs();
        }