예제 #1
0
 public override bool Equals(System.Object otherFlight)
 {
     if (!(otherFlight is Flight))
     {
         return(false);
     }
     else
     {
         Flight newFlight         = (Flight)otherFlight;
         bool   idEquality        = this.GetId() == newFlight.GetId();
         bool   flightNumEquality = this.GetFlightNum() == newFlight.GetFlightNum();
         bool   statusEquality    = this.GetStatus() == newFlight.GetStatus();
         bool   timeEquality      = this.GetTime() == newFlight.GetTime();
         return(idEquality && flightNumEquality && statusEquality && timeEquality);
     }
 }
예제 #2
0
        public override bool Equals(System.Object otherFlight)
        {
            if (!(otherFlight is Flight))
            {
                return(false);
            }
            else
            {
                Flight newFlight             = (Flight)otherFlight;
                bool   idEquality            = (this.GetId() == newFlight.GetId());
                bool   flightNumberEquality  = (this.GetFlightNumber() == newFlight.GetFlightNumber());
                bool   departureTimeEquality = (this.GetDepartureTime() == newFlight.GetDepartureTime());
                bool   flightStatusEquality  = (this.GetStatus() == newFlight.GetStatus());

                return(idEquality && flightNumberEquality && departureTimeEquality && flightStatusEquality);
            }
        }
예제 #3
0
        public void Test_Update_UpdatesFlightStatusinDB()
        {
            //Arrange
            DateTime departureTime = new DateTime(2017, 3, 14, 9, 30, 0);
            string   flightStatus  = "On Time";
            Flight   testFlight    = new Flight("AX5390", departureTime, flightStatus);

            testFlight.Save();

            string newFlightStatus = "Delayed";

            //Act
            testFlight.UpdateStatus(newFlightStatus);


            //Assert
            string actualResult   = testFlight.GetStatus();
            string expectedResult = newFlightStatus;

            Assert.Equal(expectedResult, actualResult);
        }