Ejemplo n.º 1
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));
        }
Ejemplo n.º 2
0
        public void ShouldSortCatNamesInTheObject()
        {
            CatNamesByOwnerGender expected = new CatNamesByOwnerGender();

            expected.Add("fruits", new List <string> {
                "apple", "banana", "kiwi"
            });

            CatNamesByOwnerGender viewModel = new CatNamesByOwnerGender();

            viewModel.Add("fruits", new List <string> {
                "banana", "kiwi", "apple"
            });

            CatNamesByOwnerGender actual = CatProcessor.SortCatNames(viewModel);

            CollectionAssert.AreEqual(expected["fruits"], actual["fruits"]);
        }