コード例 #1
0
        public ActionResult Delete(int id)
        {
            Stylist thisStylist    = Stylist.Find(id);
            string  deletedStylist = thisStylist.GetStylistName();

            thisStylist.DeleteAllClients();
            thisStylist.DeleteStylist();
            return(View(deletedStylist));
        }
コード例 #2
0
        public ActionResult Delete(int id)
        {
            Stylist thisStylist    = Stylist.Find(id);
            int     deletedStylist = thisStylist.GetId();

            thisStylist.DeleteAllClients();
            thisStylist.DeleteStylist();
            return(View(thisStylist));
        }
コード例 #3
0
        public void DeleteAllClients_RemovesAllClientsFromStylist_Stylist()
        {
            //Arrange
            Stylist newStylist = new Stylist("Ivan");

            newStylist.Save();
            Client newClient = new Client("Dalia", newStylist.GetId());

            newClient.Save();
            Client newClient2 = new Client("Person", newStylist.GetId());

            newClient2.Save();
            List <Client> testClients = new List <Client> {
            };

            //Act
            newStylist.DeleteAllClients();
            List <Client> resultClients = newStylist.GetClients();

            //Assert
            CollectionAssert.AreEqual(testClients, resultClients);
        }