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)); }
public void ShouldReturnCatNamesOnlyWhenMixTypeProvided() { 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 Pet { Name = "Ket", Type = "Cat" } } }, new PetOwner { Gender = "unspecified", Pets = new List <Pet> { new Pet { Name = "Raty", Type = "Cat" }, new Pet { Name = "Stone", Type = "Horse" } } } }; CatNamesByOwnerGender expected = new CatNamesByOwnerGender(); expected.Add("female", new List <string> { "Ket" }); expected.Add("unspecified", new List <string> { "Raty" }); CatNamesByOwnerGender actual = CatProcessor.LoadCatNamesByOwnerGender(actualList); Assert.AreEqual(expected["female"].Count, actual["female"].Count); Assert.AreEqual(expected["unspecified"].Count, actual["unspecified"].Count); // TODO: Add object comparison }