示例#1
0
        public async Task CountAllBookings_Returns_Right_Number_Of_Bookings()
        {
            var CompanyCustomerMock = new Mock <IDelpinHttpClientHandler <CompanyCustomer> >();

            var PrivateCustomerMock = new Mock <IDelpinHttpClientHandler <PrivateCustomer> >();

            var BookingMock = new Mock <IDelpinHttpClientHandler <Booking> >();

            int NumberBooking = 5;

            BookingMock.Setup(m => m.GetCountHttp(It.IsAny <string>(), It.IsAny <string>()))
            .ReturnsAsync(NumberBooking);

            var sut = new StatisticController(Configuration(), PrivateCustomerMock.Object, CompanyCustomerMock.Object, BookingMock.Object);


            var countBookings = await sut.CountAllBookings();

            Assert.Equal(NumberBooking, countBookings);
        }