Beispiel #1
0
 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());
         bool  locationEquality = (this.GetLocation() == newVenue.GetLocation());
         bool  capacityEquality = (this.GetCapacity() == newVenue.GetCapacity());
         return(idEquality && nameEquality && capacityEquality && locationEquality);
     }
 }
Beispiel #2
0
        public void Test_Update_UpdatesVenueInDatabase()
        {
            //Arrange
            Venue testVenue = new Venue("Rose Quarter", "Portland", 20000);

            testVenue.Save();
            string newName     = "moda";
            string newLocation = "mars";
            int    newCapacity = 10000;

            //Act
            testVenue.Update("moda", "mars", 10000);
            string result1 = testVenue.GetName();
            string result2 = testVenue.GetLocation();
            int    result3 = testVenue.GetCapacity();

            //Assert
            Assert.Equal(newName, result1);
            Assert.Equal(newLocation, result2);
            Assert.Equal(newCapacity, result3);
        }