Exemplo n.º 1
0
        public async Task UpdateBookingStatusAsync_BookingExistsAndBookingStatusExists_ShouldReturnTheBooking()
        {
            // Arrange
            moqRepository.Setup(x => x.GetBookingByIdAsync(It.IsAny <int>())).ReturnsAsync(expectedBooking);
            moqRepository.Setup(x => x.GetBookingStatusByNameAsync(It.IsAny <string>()))
            .ReturnsAsync(expectedBookingStatus);
            moqRepository.Setup(x => x.UpdateBookingStatusAsync(It.IsAny <int>(), It.IsAny <BookingStatus>()))
            .ReturnsAsync(expectedBooking);

            // Act
            var actualBooking = await service.UpdateBookingStatusAsync(bookingId, bookingStatus);

            // Assert
            moqRepository.VerifyAll();
            Assert.AreEqual(expectedBooking, actualBooking);
        }