Esempio n. 1
0
        public ActionResult Update(int specialityId, string newName)
        {
            Speciality thisSpeciality = Speciality.Find(specialityId);

            thisSpeciality.Edit(newName);
            return(RedirectToAction("Show", new { id = specialityId }));
        }
        public ActionResult EditDetails(int id, string specialityName)
        {
            Speciality editSpeciality = Speciality.Find(id);

            editSpeciality.Edit(specialityName);
            return(RedirectToAction("Index", "Home", new { activeId = 3 }));
        }
Esempio n. 3
0
        public ActionResult Update(int id)
        {
            Speciality thisSpeciality = Speciality.Find(id);

            thisSpeciality.Edit(Request.Form["updatespeciality"]);
            return(RedirectToAction("Index"));
        }
Esempio n. 4
0
        public void Edit_UpdatesSpecialityNameInDatabase_String()
        {
            Speciality testSpeciality = new Speciality("Cut");

            testSpeciality.Save();
            string secondName = "Color";

            testSpeciality.Edit(secondName);
            string result = Speciality.Find(testSpeciality.GetId()).GetName();

            Assert.AreEqual(secondName, result);
        }
        public void Edit_Test()
        {
            //Arrange
            Speciality newSpeciality = new Speciality("layer cut");

            newSpeciality.Save();
            Speciality expectedSpeciality = new Speciality("hair coloring", newSpeciality.GetSpecialityId());

            //Act
            newSpeciality.Edit("hair coloring");

            //Assert
            Assert.AreEqual(expectedSpeciality, newSpeciality);
        }
Esempio n. 6
0
        public void Edit_EditedSpecialityHasDifferentValue_True()
        {
            //Arrange
            Speciality specialityOne = new Speciality("Cutting");
            Speciality specialityTwo = new Speciality("Braiding");

            specialityOne.Save();
            int id = specialityOne.GetId();

            //Act
            specialityOne.Edit("Braiding");
            Speciality foundSpeciality = Speciality.Find(id);

            //Assert
            Assert.AreEqual(specialityTwo, foundSpeciality);
        }