public void Test_Update_CuisineName() { Cuisine testCuisine = new Cuisine("Chinese Food"); testCuisine.Save(); testCuisine.Update("Italian Food"); Cuisine newCuisine = new Cuisine("Italian Food"); Assert.Equal(testCuisine.GetName(), newCuisine.GetName()); }
public override bool Equals(System.Object otherCuisine) { if (!(otherCuisine is Cuisine)) { return(false); } else { Cuisine newCuisine = (Cuisine)otherCuisine; bool idEquality = this.GetId() == newCuisine.GetId(); bool nameEquality = this.GetName() == newCuisine.GetName(); return(idEquality && nameEquality); } }
public void Test_Update_UpdatesCuisineInDatabase() { string name = "Chinese"; Cuisine testCuisine = new Cuisine(name); testCuisine.Save(); string newName = "French"; testCuisine.Update(newName); string result = testCuisine.GetName(); Assert.Equal(newName, result); }