Exemplo n.º 1
0
        public ActionResult addSpecialty(int id)
        {
            Dictionary <string, object> model = new Dictionary <string, object>();

            Specialty.AddNewSpecialtyJoinStylist(id, int.Parse(Request.Form["new-specialty"]));
            List <Specialty> selectedSpecialty = Stylist.GetSpecialtyByStylist(id);
            Stylist          selectedStylist   = Stylist.Find(id);

            model.Add("SpecialtyList", selectedSpecialty);
            model.Add("StylistName", selectedStylist);

            return(View("stylistsSpecialties", model));
        }
Exemplo n.º 2
0
        public void Add_AddtoStylists_clients()
        {
            Stylist testStylist1 = new Stylist("testName");

            testStylist1.Save();
            Specialty testSpecialty1 = new Specialty("test1");

            testSpecialty1.Save();

            Specialty.AddNewSpecialtyJoinStylist(testStylist1.GetId(), testSpecialty1.GetSpecialtyId());
            List <Stylist> testSpecialty = Specialty.GetStylistBySpecialty(testSpecialty1.GetSpecialtyId());

            Assert.AreEqual(1, testSpecialty.Count);
        }
Exemplo n.º 3
0
/////find specialties by stylist Id
        public void Get_SpecialtiesFromStylistId()
        {
            Stylist testStylist1 = new Stylist("testName");

            testStylist1.Save();
            Specialty testSpecialty1 = new Specialty("testSpecialtyName");

            testSpecialty1.Save();

            Specialty.AddNewSpecialtyJoinStylist(testStylist1.GetId(), testSpecialty1.GetSpecialtyId());

            List <Specialty> testSpecialty = Stylist.GetSpecialtyByStylist(testStylist1.GetId());

            Assert.AreEqual("testSpecialtyName", testSpecialty[0].GetSpecialtyName());
        }
Exemplo n.º 4
0
        public void Delete_DeleteFromStylists_specialty()
        {
            Stylist testStylist1 = new Stylist("testName");

            testStylist1.Save();
            Specialty testSpecialty1 = new Specialty("test1");

            testSpecialty1.Save();
            Specialty.AddNewSpecialtyJoinStylist(testStylist1.GetId(), testSpecialty1.GetSpecialtyId());
            testSpecialty1.DeleteFromJoin();

            List <Stylist> testSpecialty = Specialty.GetStylistBySpecialty(testSpecialty1.GetSpecialtyId());

            Assert.AreEqual(0, testSpecialty.Count);
        }