public void SaveAndGetAll_SavesToDatabaseAndReturnAll_Specialties() { //Arrange Specialties testSpecialty = new Specialties("testName"); //Act testSpecialty.Save(); List <Specialties> result = Specialties.GetAll(); List <Specialties> testList = new List <Specialties> { testSpecialty }; //Assert CollectionAssert.AreEqual(testList, result); }
public void Save_AssignsIdToObject_Id() { //Arrange Specialties testSpecialty = new Specialties("testName"); //Act testSpecialty.Save(); Specialties savedSpecialty = Specialties.GetAll()[0]; int result = savedSpecialty.GetId(); int testId = testSpecialty.GetId(); //Assert Assert.AreEqual(testId, result); }
public ActionResult Index() { List <Specialties> allSpecialties = Specialties.GetAll(); return(View(allSpecialties)); }