public void Add_WhenAddFemaleBear_ReturnsTrue()
        {
            cage.Add(bear);

            Assert.NotEmpty(cage.Components);
            Assert.NotEmpty(cage.GetAnimals());
            Assert.Equal(bear, cage.Components[0]);
        }
Example #2
0
        public void IsContainerAlreadyContainsComponent_WhenTryToAddAlreadyExistingAnimal_ReturnsTrue()
        {
            bearCage.Add(bearFemaleCage);
            Bear bear = new BearFactory().CreateAnimal(Lab2Zoo.Models.Enums.MaleMode.Female) as Bear;

            bearFemaleCage.Add(bear);

            Assert.True(bearCage.IsContainerAlreadyContainsComponent(bear));
        }
Example #3
0
 public void Add_WhenAddMaleBeartoFemaleCage_ReturnsTypeAccessException()
 {
     Assert.Throws <TypeAccessException>(() => bearFemaleCage.Add(maleBear));
 }