public void DeleteEnclosureExistingRecurringEvents() { var encs = enclosureController.GetAllEnclosures(); var details = enclosureController.GetEnclosureDetailsById(1); var animalsController = new AnimalController(); var animals = animalsController.GetAnimalResultByEnclosure(1, (int)Languages.he).ToList(); Assert.AreEqual(2, animals.Count()); foreach (AnimalResult a in animals) { animalsController.DeleteAnimal((int)a.Id); } animals = animalsController.GetAnimalResultByEnclosure(1, (int)Languages.he).ToList(); Assert.AreEqual(0, animals.Count()); Assert.AreEqual(4, encs.Count()); Assert.AreEqual(2, details.Count()); Assert.AreEqual(1, enclosureController.GetRecurringEvents(1, 1).Count()); enclosureController.DeleteEnclosure(1); }
public void DeleteEnclosureExistingAnimals() { var encs = enclosureController.GetAllEnclosures(); var details = enclosureController.GetEnclosureDetailsById(1); var animalsController = new AnimalController(); var recurringEvents = enclosureController.GetRecurringEvents(1, 1); Assert.AreEqual(1, recurringEvents.Count()); enclosureController.DeleteRecurringEvent(1, (int)recurringEvents.First().id); Assert.AreEqual(0, enclosureController.GetRecurringEvents(1, 1).Count()); Assert.AreEqual(2, animalsController.GetAnimalResultByEnclosure(1, (int)Languages.he).Count()); Assert.AreEqual(4, encs.Count()); Assert.AreEqual(2, details.Count()); enclosureController.DeleteEnclosure(1); }
public void DeleteEnclosureValidInput() { var encs = enclosureController.GetAllEnclosures(); var details = enclosureController.GetEnclosureDetailsById(4); var animalsController = new AnimalController(); Assert.AreEqual(0, enclosureController.GetRecurringEvents(4, (int)Languages.he).Count()); Assert.AreEqual(0, animalsController.GetAnimalResultByEnclosure(4, (int)Languages.he).Count()); Assert.AreEqual(4, encs.Count()); Assert.AreEqual(1, details.Count()); enclosureController.DeleteEnclosure(4); encs = enclosureController.GetAllEnclosures(); Assert.AreEqual(3, encs.Count()); details = enclosureController.GetEnclosureDetailsById(4); Assert.AreEqual(0, details.Count()); }
public void GetAnimalResultByEnclosureValidInput() { var animals = animalsController.GetAnimalResultByEnclosure(1, (int)Languages.he); Assert.AreEqual(2, animals.Count()); }