//add a view foragaers method
        private void ViewForagers()
        {
            view.DisplayHeader(MainMenuOption.ViewForagers.ToLabel());
            string         lastNamePrefix = view.GetForagerNamePrefix();
            List <Forager> foragers       = foragerService.FindByLastName(lastNamePrefix);

            view.DisplayHeader("Foragers");
            view.DisplayForagers(foragers);
            view.EnterToContinue();
        }
Exemple #2
0
        public void ShouldNotFindForager()
        {
            ForagerRepositoryDouble repo    = new ForagerRepositoryDouble();
            ForagerService          service = new ForagerService(repo);

            List <Forager> result = service.FindByLastName("A");

            Assert.AreEqual(0, result.Count);
        }
Exemple #3
0
        public void ShouldFindForager()
        {
            //arrange
            ForagerRepositoryDouble repo    = new ForagerRepositoryDouble();
            ForagerService          service = new ForagerService(repo);

            //act
            List <Forager> result = service.FindByLastName("Sis");

            //assert
            Assert.AreEqual(1, result.Count);
            Assert.AreEqual("Jilly", result[0].FirstName);
        }