public AnimalSanctuaryController()
 {
     _image   = new ImageDBRepository();
     _animal  = new AnimalDBRepository();
     _sounds  = new SoundDBRepository();
     _profile = new ProfileDBRepository(System.Web.HttpContext.Current);
     _options = new OptionsDBRepository();
 }
Beispiel #2
0
        public void ShowAnimalImageTest()
        {
            AnimalDBRepository _animal = new AnimalDBRepository();
            int AnimalID        = 2;
            int expectedImageID = 8;

            Animal animal = _animal.Get(AnimalID);      //get animal from database
            Images image  = _image.Get(animal.ImageID); //get animal image from database

            Assert.AreEqual(expectedImageID, image.ID);
        }
        public void PlayAnimalSoundTest()
        {
            AnimalDBRepository _animal = new AnimalDBRepository();
            SoundDBRepository  _sound  = new SoundDBRepository();
            int AnimalID        = 2;
            int expectedSoundID = 6;

            Animal animal = _animal.Get(AnimalID);      //get animal from database
            Sounds sound  = _sound.Get(animal.SoundID); //get animal sound from database

            Assert.AreEqual(expectedSoundID, sound.ID);
        }