コード例 #1
0
 public void Test_UpdateReservation()
 {
     AutoReservationBusinessComponent arvc = new AutoReservationBusinessComponent();
     Reservation original = arvc.GetAllReservations()[0];
     Reservation modified = arvc.GetAllReservations()[0];
     modified.Bis = new DateTime(2099, 12, 31);
     arvc.UpdateReservation(original, modified);
     Reservation newReservation = arvc.GetAllReservations()[0];
     Assert.AreEqual(new DateTime(2099, 12, 31), modified.Bis);
 }
コード例 #2
0
 public void UpdateReservationTest()
 {
     TestEnvironmentHelper.InitializeTestData();
     AutoReservationBusinessComponent autoReservation = new AutoReservationBusinessComponent();
     IList<Reservation> reservationen = autoReservation.Reservationen;
     Reservation original = reservationen[0];
     Reservation modified = reservationen[0];
     modified.Bis = System.DateTime.Today;
     autoReservation.UpdateReservation(modified, original);
     Reservation modifiedAgain = reservationen[0];
     Assert.AreEqual(modified, modifiedAgain);
 }
コード例 #3
0
        public void UpdateReservationTest()
        {
            TestEnvironmentHelper.InitializeTestData();
            AutoReservationBusinessComponent autoReservation = new AutoReservationBusinessComponent();
            IList<Reservation> reservationen = autoReservation.GetReservationen();
            Reservation modified = reservationen[0];
            int reservationId = modified.ReservationNr;
            Reservation original = Reservation.CreateReservation(modified.ReservationNr, modified.AutoId, modified.KundeId, modified.Von, modified.Bis);
            DateTime modifiedDate = System.DateTime.Today;
            modified.Bis = modifiedDate;
            autoReservation.UpdateReservation(modified, original);

            Reservation reservationFetchedFromDb = autoReservation.GetReservation(reservationId);
            Assert.AreEqual(modified.Bis, reservationFetchedFromDb.Bis);
        }