Пример #1
0
        public async Task CountAllPrivateCustomers_Returns_Right_Number_Of_PrivateCustomers()
        {
            var CompanyCustomerMock = new Mock <IDelpinHttpClientHandler <CompanyCustomer> >();

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

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

            int NumberOfPrivateCustomers = 5;

            PrivateCustomerMock.Setup(m => m.GetCountHttp(It.IsAny <string>(), It.IsAny <string>()))
            .ReturnsAsync(NumberOfPrivateCustomers);

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


            var countPrivateCustomers = await sut.CountAllPrivateCustomers();

            Assert.Equal(NumberOfPrivateCustomers, countPrivateCustomers);
        }