コード例 #1
0
 // stops doubles between database and object
 public override bool Equals(System.Object otherVenue)
 {
     if (!(otherVenue is Venue))
     {
         return(false);
     }
     else
     {
         Venue newVenue     = (Venue)otherVenue;
         bool  idEquality   = this.GetId() == newVenue.GetId();
         bool  nameEquality = this.GetName() == newVenue.GetName();
         return(idEquality && nameEquality);
     }
 }
コード例 #2
0
        public void Test_Update_UpdateVenueInData()
        {
            // Arrange
            Venue oldVenue = new Venue("Madison Square Garden");

            oldVenue.Save();

            string newVenue = "The Knitting Factory";

            // Act
            oldVenue.Update(newVenue);

            string result = oldVenue.GetName();

            // Assert
            Assert.Equal(newVenue, result);
        }