Exemplo n.º 1
0
        public void ShouldFilterOutOnlyCatOwnersWhenNoneType()
        {
            List <PetOwner> expected = new List <PetOwner>();

            List <PetOwner> actualList = new List <PetOwner> {
                new PetOwner {
                    Gender = "male",
                    Pets   = new List <Pet>()
                },
                new PetOwner {
                    Gender = "female",
                    Pets   = new List <Pet>()
                },
                new PetOwner {
                    Gender = "unspecified",
                    Pets   = new List <Pet>()
                }
            };

            List <PetOwner> actual = PetProcessor.GetOwnersByPetType(actualList, "Cat");

            Assert.AreNotEqual(expected.Count, actualList.Count);
            Assert.AreEqual(expected.Count, actual.Count);
            // TODO: Add object comparison
        }
Exemplo n.º 2
0
        private string ProcessResults(List <PetOwner> owners)
        {
            owners = PetProcessor.RemoveOwnersWithoutPets(owners);
            owners = PetProcessor.GetOwnersByPetType(owners, Pets.cat);

            CatNamesByOwnerGender catNamesViewModel = CatProcessor.LoadCatNamesByOwnerGender(owners);

            catNamesViewModel = CatProcessor.SortCatNames(catNamesViewModel);

            return(HTMLProcessor.FormatHTML(catNamesViewModel));
        }
Exemplo n.º 3
0
        public void ShouldFilterOutOnlyCatOwnersWhenNoCatTypes()
        {
            List <PetOwner> expected = new List <PetOwner>();

            List <PetOwner> actualList = new List <PetOwner> {
                new PetOwner {
                    Gender = "male",
                    Pets   = new List <Pet> {
                        new Pet {
                            Name = "Jacky", Type = "Dog"
                        }
                    }
                },
                new PetOwner {
                    Gender = "female",
                    Pets   = new List <Pet> {
                        new Pet {
                            Name = "Rock", Type = "Dog"
                        }
                    }
                },
                new PetOwner {
                    Gender = "unspecified",
                    Pets   = new List <Pet> {
                        new Pet {
                            Name = "Stone", Type = "Horse"
                        }
                    }
                }
            };

            List <PetOwner> actual = PetProcessor.GetOwnersByPetType(actualList, "Cat");

            Assert.AreNotEqual(expected.Count, actualList.Count);
            Assert.AreEqual(expected.Count, actual.Count);
            // TODO: Add object comparison
        }