Esempio n. 1
0
            public void ModifyBookingNoteRecordsEventWithCorrectBookingId()
            {
                // Arrange
                const int BOOKING_ID = 123;
                const string BOOKING_NOTE = "Test123";

                var bookingDao = new Mock<IBookingDao>();
                var eventTrackingManager = new Mock<IEventTrackingManager>();
                bookingDao.Setup(b => b.ModifyBookingNote(It.Is<int>(i => i == BOOKING_ID), It.Is<string>(i => i == BOOKING_NOTE))).Returns(true);
                eventTrackingManager.Setup(b => b.CreateBookingEvent(It.Is<int>(i => i == BOOKING_ID), It.Is<BookingEventType>(i => i == BookingEventType.Modified), It.IsAny<string>()));

                var bookingManager = new BookingManager
                {
                    EventTrackingManager = eventTrackingManager.Object,
                    BookingDao = bookingDao.Object
                };

                // Act
                var status = bookingManager.ModifyBookingNote(BOOKING_ID, BOOKING_NOTE);

                // Assert
                Assert.IsTrue(status, "Booking Note was not updated");
                bookingDao.VerifyAll();
                eventTrackingManager.VerifyAll();
            }