public void GetAll_VetsEmptyAtFirst_List() { //Arrange, Act int result = Vet.GetAll().Count; //Assert Assert.AreEqual(0, result); }
public ActionResult Create(string vetName, string vetSpecialty) { Vet newVet = new Vet(vetName, vetSpecialty); newVet.Save(); List <Vet> allVets = Vet.GetAll(); return(View("Index", allVets)); }
public ActionResult Show(int id) { Dictionary <string, object> model = new Dictionary <string, object>(); Patient selectedPatient = Patient.Find(id); List <Vet> patientVets = selectedPatient.GetVets(); List <Vet> allVets = Vet.GetAll(); model.Add("selectedPatient", selectedPatient); model.Add("patientVets", patientVets); model.Add("allVets", allVets); return(View(model)); }
public void Save_DatabaseAssignsIdToVet_Id() { //Arrange Vet testVet = new Vet("Doctor Phil", "Headstuff"); testVet.Save(); //Act Vet savedVet = Vet.GetAll()[0]; int result = savedVet.Id; int testId = testVet.Id; //Assert Assert.AreEqual(testId, result); }
public void Save_SavesVetToDatabase_VetList() { //Arrange Vet testVet = new Vet("Doctor Phil", "Headstuff"); testVet.Save(); //Act List <Vet> result = Vet.GetAll(); List <Vet> testList = new List <Vet> { testVet }; //Assert CollectionAssert.AreEqual(testList, result); }
public void GetAll_ReturnsAllVetObjects_VetList() { //Arrange Vet newVet1 = new Vet("Doctor Bill", "Buttstuff"); newVet1.Save(); Vet newVet2 = new Vet("Doctor Phil", "Headstuff"); newVet2.Save(); List <Vet> newList = new List <Vet> { newVet1, newVet2 }; //Act List <Vet> result = Vet.GetAll(); //Assert CollectionAssert.AreEqual(newList, result); }
public ActionResult Index() { List <Vet> allVets = Vet.GetAll(); return(View(allVets)); }