public void GetId_ReturnsId_Id() { Speciality newSpeciality = new Speciality("Hairmaster", 1); int result = 1; Assert.AreEqual(result, newSpeciality.GetId()); }
public void Find_ReturnsSpecialityInDatabase_Speciality() { Speciality testSpeciality = new Speciality("Cut"); testSpeciality.Save(); Speciality foundSpeciality = Speciality.Find(testSpeciality.GetId()); Assert.AreEqual(testSpeciality, foundSpeciality); }
public void Save_DatabaseAssignsIdToStylist_Id() { Speciality testSpeciality = new Speciality("Cut"); testSpeciality.Save(); Speciality savedSpeciality = Speciality.GetAll()[0]; int result = savedSpeciality.GetId(); int testId = testSpeciality.GetId(); Assert.AreEqual(testId, result); }
public void Edit_UpdatesSpecialityNameInDatabase_String() { Speciality testSpeciality = new Speciality("Cut"); testSpeciality.Save(); string secondName = "Color"; testSpeciality.Edit(secondName); string result = Speciality.Find(testSpeciality.GetId()).GetName(); Assert.AreEqual(secondName, result); }
public void Find_Save_GetID_Speciality() { //Arrange Speciality testSpeciality = new Speciality("test1"); testSpeciality.Save(); //Act Speciality foundSpeciality = Speciality.Find(testSpeciality.GetId()); Assert.AreEqual(testSpeciality, foundSpeciality); }
public void Find_FindSpeciality_FoundSpeciality() { //Arrange Speciality speciality1 = new Speciality("Cut"); speciality1.Save(); //Act Speciality foundSpeciality = Speciality.Find(speciality1.GetId()); //why just 0 doens't work? //Assert Assert.AreEqual(speciality1, foundSpeciality); }
public void Find_FindMatchingSpeciality_True() { //Arrange Speciality specialityOne = new Speciality("Cutting"); specialityOne.Save(); int id = specialityOne.GetId(); //Act Speciality foundSpeciality = Speciality.Find(id); //Assert Assert.AreEqual(specialityOne, foundSpeciality); }
public void Edit_EditedSpecialityHasDifferentValue_True() { //Arrange Speciality specialityOne = new Speciality("Cutting"); Speciality specialityTwo = new Speciality("Braiding"); specialityOne.Save(); int id = specialityOne.GetId(); //Act specialityOne.Edit("Braiding"); Speciality foundSpeciality = Speciality.Find(id); //Assert Assert.AreEqual(specialityTwo, foundSpeciality); }
public void Delete_SpecialityDeletedFromDB_True() { //Arrange Speciality specialityOne = new Speciality("Cutting"); specialityOne.Save(); int id = specialityOne.GetId(); Speciality defaultSpeciality = new Speciality("", 0); //Act Speciality.Delete(id); Speciality notFound = Speciality.Find(id); //Assert Assert.AreEqual(notFound, defaultSpeciality); }
public void Edit_UpdatesSpecialityInDatabase_String() { string firstName = "Tests"; Speciality testName = new Speciality(firstName, 1); testName.Save(); string testSecondName = "Are fun"; //Act testName.UpdateDescription(testSecondName); string result = Speciality.Find(testName.GetId()).GetDescription(); //Assert Assert.AreEqual(testSecondName, result); }