public override bool Equals(System.Object otherCategoryDisease) { if (!(otherCategoryDisease is CategoryDisease)) { return(false); } else { CategoryDisease newCategoryDisease = (CategoryDisease)otherCategoryDisease; bool idEquality = (this.GetId() == newCategoryDisease.GetId()); bool nameEquality = (this.GetName() == newCategoryDisease.GetName()); return(idEquality && nameEquality); } }
public void Test_Update_UpdatesCategoryDiseaseInDatabase() { //Arrange string name = "physical injuries"; CategoryDisease testCategoryDisease = new CategoryDisease(name); testCategoryDisease.Save(); string newName = "cancer"; //Act testCategoryDisease.Update("cancer"); string result = testCategoryDisease.GetName(); //Assert Assert.Equal(newName, result); }