public void Get_GetStylistFromStylists_clients_byClientId() { Stylist testStylist1 = new Stylist("testName"); testStylist1.Save(); Client testClient1 = new Client("test1"); testClient1.Save(); Stylist.AddNewClient(testStylist1.GetId(), testClient1.GetId()); List <Client> testClient = Stylist.GetClientsByStylist(testStylist1.GetId()); Assert.AreEqual(testClient1.GetId(), testClient[0].GetId()); }
public void Add_AddtoStylists_clients() { Stylist testStylist1 = new Stylist("testName"); testStylist1.Save(); Client testClient1 = new Client("test1"); testClient1.Save(); Stylist.AddNewClient(testStylist1.GetId(), testClient1.GetId()); List <Stylist> testStylist = Client.GetStylistByClient(testClient1.GetId()); // List<Client> testClient = Stylist.GetClientsByStylist(testStylist1.GetId()); Assert.AreEqual(1, testStylist.Count); }
public void Delete_DeleteFromStylists_clients_byClientId() { Stylist testStylist1 = new Stylist("testName"); testStylist1.Save(); Client testClient1 = new Client("test1"); testClient1.Save(); Stylist.AddNewClient(testStylist1.GetId(), testClient1.GetId()); testClient1.DeleteFromJoin(); List <Stylist> testStylist = Client.GetStylistByClient(testClient1.GetId()); Assert.AreEqual(0, testStylist.Count); }
public ActionResult Edit(int id) { Dictionary <string, object> model = new Dictionary <string, object>(); Client newClient = new Client(Request.Form["new-client"]); newClient.Save(); Stylist.AddNewClient(id, newClient.GetId()); List <Client> selectedClients = Stylist.GetClientsByStylist(id); Stylist selectedStylist = Stylist.Find(id); model.Add("clientList", selectedClients); model.Add("StylistName", selectedStylist); return(View("ClientList", model)); }