Ejemplo n.º 1
0
        public void CanRetrieveAllPets()
        {
            //Arrange
            var mockPetAccessor = new PetAccessorMock();
            var petManager      = new PetManager(mockPetAccessor);
            //Act
            var result = petManager.RetrieveAllPets();

            //Assert
            Assert.AreEqual(4, result.Count);
            petManager.CreatePet(new Pet());
            petManager.CreatePet(new Pet());
            result = petManager.RetrieveAllPets();
            Assert.AreEqual(6, result.Count);
        }
Ejemplo n.º 2
0
        private void populatePets()
        {
            try
            {
                _pets = _petManager.RetrieveAllPets();

                foreach (Pet pet in _pets) // added on 3/14/19 by Matt H.
                {
                    pet.imageFilename = _petManager.RetrievePetImageFilenameByPetID(pet.PetID);
                }

                dgPets.ItemsSource = _pets;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\nCould not retrieve the list of Pets." + "\n" + ex.StackTrace);
            }
        }