Ejemplo n.º 1
0
        public IActionResult Delete(int id)
        {
            Specialty newSpecialty = Specialty.Find(id);

            newSpecialty.Delete();
            return(RedirectToAction("Index"));
        }
        public ActionResult Destroy(int id)
        {
            Specialty deleteSpecialty = Specialty.Find(id);

            deleteSpecialty.Delete();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
        public ActionResult DeleteOne(int id)
        {
            Specialty thisSpecialty = Specialty.Find(id);

            thisSpecialty.Delete();
            return(RedirectToAction("index"));
        }
Ejemplo n.º 4
0
        public ActionResult Delete(int specialtyId)
        {
            Specialty mySpecialty = Specialty.Find(specialtyId);

            mySpecialty.Delete();
            return(RedirectToAction("Display"));
        }
Ejemplo n.º 5
0
        public ActionResult SpecialtyDelete(int SpecialtyId)
        {
            Specialty.Delete(SpecialtyId);
            List <Specialty> allSpecialty = Specialty.GetAll();

            return(View("Index", allSpecialty));
        }
Ejemplo n.º 6
0
        public ActionResult DeleteSpecialty(int id)
        {
            Specialty thisSpecialty = Specialty.Find(id);

            thisSpecialty.Delete();
            return(RedirectToAction("AllSpecialties"));
        }
Ejemplo n.º 7
0
        public ActionResult Delete(int specialtyId)
        {
            Specialty specialty = Specialty.Find(specialtyId);

            specialty.Delete();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 8
0
        public void Delete_DeletesSpecialtyAssociationsFromDatabase_SpecialtyList()
        {
            //Arrange
            Stylist testStylist = new Stylist("x", "y", "z");

            testStylist.Save();

            string testTitle       = "Loctician";
            string testDescription = "Specializing in dreadlocks.";

            Specialty testSpecialty = new Specialty(testTitle, testDescription);

            testSpecialty.Save();

            //Act
            testSpecialty.AddStylist(testStylist);
            testSpecialty.Delete();

            List <Specialty> resultStylistSpecialties = testStylist.GetSpecialties();
            List <Specialty> testStylistSpecialties   = new List <Specialty> {
            };

            //Assert
            CollectionAssert.AreEqual(testStylistSpecialties, resultStylistSpecialties);
        }
        public ActionResult Delete(int id)
        {
            Specialty deleteSpecialty = Specialty.Find(id);

            deleteSpecialty.Delete();

            return(RedirectToAction("ViewAll"));
        }
Ejemplo n.º 10
0
        public ActionResult Destroy(int specialtyId)
        {
            Specialty specialty = Specialty.Find(specialtyId);

            specialty.Delete();
            List <Specialty> allSpecialties = Specialty.GetAll();

            return(RedirectToAction("Index", allSpecialties));
        }
        public ActionResult Delete(int id)
        {
            Specialty thisSpecialty = Specialty.Find(id);

            thisSpecialty.Delete();
            List <Specialty> allSpecialties = Specialty.GetAll();

            return(View("Index", allSpecialties));
        }
Ejemplo n.º 12
0
        public ActionResult DeleteSpecialtyFinal(int id)
        {
            Specialty selectedSpecialty = Specialty.Find(id);

            selectedSpecialty.Delete();
            selectedSpecialty.DeleteFromJoin();

            return(View());
        }
Ejemplo n.º 13
0
        public ActionResult DeleteSpecialty(int id)
        {
            Specialty newSpecialty = Specialty.Find(id);

            newSpecialty.Delete();
            List <Specialty> allSpecialtys = Specialty.GetAll();

            return(RedirectToAction("Specialtys", allSpecialtys));
        }
Ejemplo n.º 14
0
        public ActionResult Delete(string specialtyId)
        {
            int       intSpecialtyId = int.Parse(specialtyId);
            Specialty foundSpecialty = Specialty.Find(intSpecialtyId);

            foundSpecialty.Delete();
            List <Specialty> allSpecialties = Specialty.GetListOfSpecialties();

            return(RedirectToAction("Index", allSpecialties));
        }
Ejemplo n.º 15
0
        public ActionResult Delete(int specialtyId)
        {
            Specialty specialty = Specialty.Find(specialtyId);

            specialty.Delete();
            Dictionary <string, object> model = new Dictionary <string, object>();

            model.Add("specialty", specialty);
            return(View(model));
        }
Ejemplo n.º 16
0
        public ActionResult Delete(int id)
        {
            Specialty currentSpecialty = Specialty.Find(id);

            currentSpecialty.Delete(currentSpecialty.GetId());

            List <Specialty> allSpecialtys = Specialty.GetAll();

            return(View("Index", allSpecialtys));
        }
Ejemplo n.º 17
0
        public ActionResult DeleteSpecialty(int specialtyId)
        {
            Specialty specialty = Specialty.Find(specialtyId);

            specialty.Delete();
            // Dictionary<string, object> model = new Dictionary<string, object>();
            // Stylist foundStylist = Stylist.Find(authorId);
            // List<Specialty> authorSpecialtys = foundStylist.GetSpecialtys();
            // model.Add("specialty", authorSpecialtys);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 18
0
        public void Specialty_Delete_DeletesFromDB()
        {
            Specialty newspec = new Specialty("Specialty Name");

            newspec.Save();
            int id = newspec.GetID();

            newspec.Delete();
            Specialty fromDB = Specialty.GetByID(id);

            Assert.IsNull(fromDB);
        }
        public void Delete_DeletesInstanceofSpecialty_EmptyList()
        {
            Specialty specialty = new Specialty("Bangs");

            specialty.Save();
            specialty.Delete();
            List <Specialty> expected = new List <Specialty> {
            };
            List <Specialty> result   = Specialty.GetAll();

            CollectionAssert.AreEqual(expected, result);
        }
Ejemplo n.º 20
0
        public void Specialtys_Detele_Seocond_Way()
        {
            Specialty firstSpecialty = new Specialty("color");

            firstSpecialty.Save();
            int id = firstSpecialty.GetSpecialtyId();

            Specialty.Delete(id);
            int num = Specialty.GetAll().Count;

            Assert.AreEqual(0, num);
        }
Ejemplo n.º 21
0
        public void Delete_DeletesASpecialty()
        {
            Specialty testSpecialty = new Specialty("test specialty type");

            testSpecialty.Save();

            testSpecialty.Delete();

            List <Specialty> allSpecialties = Specialty.GetListOfSpecialties();
            List <Specialty> result         = new List <Specialty> {
            };

            CollectionAssert.AreEqual(allSpecialties, result);
        }
Ejemplo n.º 22
0
        public void Delete_DeletesSpecialty_EmptySpecialtyList()
        {
            string    name      = "Foils";
            Specialty specialty = new Specialty(name);

            specialty.Save();
            specialty.Delete();

            List <Specialty> expected = new List <Specialty> {
            };
            List <Specialty> actual   = Specialty.GetAll();

            CollectionAssert.AreEqual(expected, actual);
        }
Ejemplo n.º 23
0
        public void Delete_RemovesSpecialtyFromDatabase_Void()
        {
            //Arrange
            Specialty testSpecialty = new Specialty("buzz cuts");

            testSpecialty.Save();

            //Act
            testSpecialty.Delete();
            List <Specialty> allSpecialties = Specialty.GetAll();

            //Assert
            Assert.AreEqual(0, allSpecialties.Count);
        }
Ejemplo n.º 24
0
        public void Delete_DeletesObject_0()
        {
            //Arrange
            Specialty testSpecialty = new Specialty("Flight");

            testSpecialty.Save();

            //Act
            testSpecialty.Delete();
            List <Specialty> result = Specialty.GetAll();

            //Assert
            Assert.AreEqual(0, result.Count);
        }
Ejemplo n.º 25
0
        public void Delete_DeletesSpecialtyFromDatabase_SpecialtyList()
        {
            Specialty testSpecialty = new Specialty("Highlights");

            testSpecialty.Save();

            List <Specialty> testList = new List <Specialty> {
                testSpecialty
            };

            testSpecialty.Delete();
            List <Specialty> result = Specialty.GetAll();

            CollectionAssert.AreEqual(testList, result);
        }
Ejemplo n.º 26
0
        public void Delete_DeleteSpecialtyInDatabase_Null()
        {
            //Arrange
            Specialty testSpecialty = new Specialty("Color");

            testSpecialty.Save();
            int testSpecialtyId = testSpecialty.id;

            //Act
            Specialty.Delete(testSpecialtyId);
            int count = Specialty.GetAll().Count;

            //Assert
            Assert.AreEqual(0, count);
        }
Ejemplo n.º 27
0
        public void Delete_DeleteSpecialtyFromDatabase_void()
        {
            Specialty testSpecialty1 = new Specialty("buzz cut");

            testSpecialty1.Save();
            Specialty testSpecialty2 = new Specialty("layering");

            testSpecialty2.Save();

            testSpecialty1.Delete();

            CollectionAssert.AreEqual(new List <Specialty> {
                testSpecialty2
            }, Specialty.GetAll());
        }
Ejemplo n.º 28
0
        public void Delete_DeletesSpecialtyInDb_SpecialtyList()
        {
            Specialty newSpecialty1 = new Specialty("Chemistry", "Science");

            newSpecialty1.Save();
            Specialty newSpecialty2 = new Specialty("Chemistry", "Science");

            newSpecialty2.Save();
            Specialty.Delete(newSpecialty1.Id);
            List <Specialty> expectedList = new List <Specialty> {
                newSpecialty2
            };
            List <Specialty> actualList = Specialty.GetAll();

            CollectionAssert.AreEqual(expectedList, actualList);
        }
        public void Delete_UpdatesSpecialtyInDatabase_String()
        {
            //Arrange
            Specialty testSpecialty  = new Specialty("test");
            Specialty testSpecialty2 = new Specialty("test2");

            testSpecialty.Save();
            testSpecialty2.Save();
            testSpecialty2.Delete(testSpecialty2.GetId());
            List <Specialty> newList = new List <Specialty> {
                testSpecialty
            };
            List <Specialty> result = Specialty.GetAll();

            CollectionAssert.AreEqual(newList, result);
        }
Ejemplo n.º 30
0
        public void Specialtys_Detele()
        {
            Specialty firstSpecialty = new Specialty("color");

            firstSpecialty.Save();
            int       id            = firstSpecialty.GetSpecialtyId();
            Specialty NullSpecialty = new Specialty("", 0);

            Specialty.Delete(id);
            //int num = Specialty.GetAll().Count;
            Specialty notFound = Specialty.Find(id);

            //Assert
            // Assert.AreEqual(0, num)
            //Assert
            Assert.AreEqual(notFound, NullSpecialty);
        }