public override bool Equals(System.Object otherPatron) { if (!(otherPatron is Patron)) { return(false); } else { Patron newPatron = (Patron)otherPatron; bool nameEquality = (this.GetName() == newPatron.GetName()); return(nameEquality); } }
public void T6_Update_UpdatesPatronInDB() { Patron testPatron = new Patron("Judy"); testPatron.Save(); string newName = "Barb"; testPatron.Update(newName); string resultName = testPatron.GetName(); Assert.Equal(newName, resultName); }
public void Update_UpdatesPatronName_Name() { Patron newPatron = new Patron("Joe"); newPatron.Save(); string newPatronName = "John"; newPatron.Update(newPatronName); string actual = newPatron.GetName(); Assert.Equal(newPatronName, actual); }
public override bool Equals(System.Object otherPatron) { if (!(otherPatron is Patron)) { return(false); } else { Patron newPatron = (Patron)otherPatron; bool idEquality = this.GetId() == newPatron.GetId(); bool nameEquality = this.GetName() == newPatron.GetName(); bool numEquality = this.GetPhone() == newPatron.GetPhone(); return(idEquality && nameEquality && numEquality); } }
public void UpdateName_OnePatron_NewName() { Patron patron1 = new Patron("Barcelona"); patron1.Save(); Patron patron2 = new Patron("Honolulu"); patron2.Save(); patron1.UpdateName("ex patron"); string newName = patron1.GetName(); Assert.Equal(newName, "ex patron"); }
public void Search_PatronTitle_FoundPatronInDatabase() { //Arrange Patron testPatron1 = new Patron("example patron1"); testPatron1.Save(); Patron testPatron2 = new Patron("example patron2"); testPatron2.Save(); //Act Patron result = Patron.Search(testPatron2.GetName()); //Assert Assert.Equal(testPatron2, result); }