Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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));
        }