Beispiel #1
0
 public void RetrievePetImageByInvalidID()
 {
     //Arrange
     var mockPetAccessor = new PetAccessorMock();
     var petManager      = new PetManager(mockPetAccessor);
     //Act
     int invalidTestID = 110000;
     var result        = petManager.RetrievePetImageFilenameByPetID(invalidTestID);
 }
Beispiel #2
0
        public void CanRetrievePetImageByID()
        {
            //Arrange
            var mockPetAccessor = new PetAccessorMock();
            var petManager      = new PetManager(mockPetAccessor);
            //Act
            int    testID         = 100099;
            string expectedString = "testPetImg.jpg";
            var    result         = petManager.RetrievePetImageFilenameByPetID(testID);

            //Assert
            Assert.AreEqual(expectedString, result);
        }
Beispiel #3
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);
            }
        }