Ejemplo n.º 1
0
        public IActionResult ChangeStylistName(int id)
        {
            Stylist thisStylist = Stylist.FindStylist(id);
            string  result      = Request.Form["new-name"];

            thisStylist.ChangeName(result);
            return(RedirectToAction("Index", "Home"));
        }
Ejemplo n.º 2
0
        public void ChangeName_ChangeStylistNameInDatabase_Stylist()
        {
            // Arrange
            Stylist testStylist = new Stylist("testName1");

            testStylist.Save();
            string testName = "testname2";

            // Act
            testStylist.ChangeName(testName);

            // Assert
            Assert.AreEqual(testName, Stylist.Find(testStylist.GetId()).GetName());
        }