public void CanDequeueFirstAndSecondAnimal() { Cat cat1 = new Cat("Fluffy"); Cat cat2 = new Cat("Kitty"); Dog dog1 = new Dog("Taco"); AnimalShelter animalShelter = new AnimalShelter(cat1); animalShelter.Enqueue(cat2); animalShelter.Enqueue(dog1); Animal someAnimal = animalShelter.DequeueWithType(); Animal anotherAnimal = animalShelter.DequeueWithType(); Assert.Equal(1, animalShelter.Size); }
public void CannotDequeueNonExistentAnimal() { Cat cat1 = new Cat("Fluffy"); AnimalShelter animalShelter = new AnimalShelter(cat1); Animal someAnimal = animalShelter.DequeueWithType(typeof(Snake)); Assert.Null(someAnimal); }
public void CanDequeueFirstAnimalOfTypeDog() { Cat cat1 = new Cat("Fluffy"); Cat cat2 = new Cat("Kitty"); Dog dog1 = new Dog("Taco"); AnimalShelter animalShelter = new AnimalShelter(cat1); animalShelter.Enqueue(cat2); animalShelter.Enqueue(dog1); Animal someAnimal = animalShelter.DequeueWithType(typeof(Dog)); Assert.IsType <Dog>(someAnimal); }