public ActionResult Details(int id) { Dictionary <string, object> model = new Dictionary <string, object>(); Stylist selectedStylist = Stylist.Find(id); List <Speciality> StylistSpeciality = selectedStylist.GetSpecialities(); List <Speciality> allSpecialitys = Speciality.GetAllSpecialitys(); model.Add("selectedStylist", selectedStylist); model.Add("StylistSpeciality", StylistSpeciality); model.Add("allSpecialitys", allSpecialitys); return(View(model)); }
public void Save_GetAllSpecialitys_Test() { //Arrange Speciality newSpeciality = new Speciality("Tom cruise style"); Speciality newSpeciality1 = new Speciality("Layer cut"); newSpeciality.Save(); newSpeciality1.Save(); //Act List <Speciality> expectedResult = new List <Speciality> { newSpeciality, newSpeciality1 }; List <Speciality> result = Speciality.GetAllSpecialitys(); //Assert CollectionAssert.AreEqual(expectedResult, result); }
public void Delete_Test() { //Arrange Speciality newSpeciality = new Speciality("keratin express"); newSpeciality.Save(); Speciality newSpeciality1 = new Speciality("hair perming"); newSpeciality1.Save(); //Act newSpeciality.Delete(); List <Speciality> result = Speciality.GetAllSpecialitys(); List <Speciality> expectedResult = new List <Speciality> { newSpeciality1 }; //Assert CollectionAssert.AreEqual(expectedResult, result); }
public ActionResult Index() { List <Speciality> allSpeciality = Speciality.GetAllSpecialitys(); return(View(allSpeciality)); }