Ejemplo n.º 1
0
        public async void Customers_Not_Exists()
        {
            var mock = new ServiceMockFacade <IStoreRepository>();

            mock.RepositoryMock.Setup(x => x.Customers(default(int), It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult <List <Customer> >(new List <Customer>()));
            var service = new StoreService(mock.LoggerMock.Object,
                                           mock.RepositoryMock.Object,
                                           mock.ModelValidatorMockFactory.StoreModelValidatorMock.Object,
                                           mock.BOLMapperMockFactory.BOLStoreMapperMock,
                                           mock.DALMapperMockFactory.DALStoreMapperMock,
                                           mock.BOLMapperMockFactory.BOLCustomerMapperMock,
                                           mock.DALMapperMockFactory.DALCustomerMapperMock);

            List <ApiCustomerResponseModel> response = await service.Customers(default(int));

            response.Should().BeEmpty();
            mock.RepositoryMock.Verify(x => x.Customers(default(int), It.IsAny <int>(), It.IsAny <int>()));
        }