コード例 #1
0
        public void CreateReservationTest()
        {
            string reservationName = "Test reservation";

            DateTime fromDate = new DateTime(1900, 01, 20);

            DateTime toDate = new DateTime(1900, 01, 21);

            DateTime currentDate = DateTime.Now;

            int reservationId = _db.AddReservation(1, reservationName, fromDate, toDate);

            Reservation reservation = _db.GetReservation(reservationId);

            Assert.AreEqual(reservationName, reservation.Name);
            Assert.AreEqual(fromDate.Date, reservation.FromDate.Date);
            Assert.AreEqual(toDate.Date, reservation.ToDate.Date);
            Assert.AreEqual(currentDate.Date, reservation.CreateDate.Date);
        }