Beispiel #1
0
        public async void Files_Not_Exists()
        {
            var mock = new ServiceMockFacade <IBucketRepository>();

            mock.RepositoryMock.Setup(x => x.Files(default(int), It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult <List <File> >(new List <File>()));
            var service = new BucketService(mock.LoggerMock.Object,
                                            mock.RepositoryMock.Object,
                                            mock.ModelValidatorMockFactory.BucketModelValidatorMock.Object,
                                            mock.BOLMapperMockFactory.BOLBucketMapperMock,
                                            mock.DALMapperMockFactory.DALBucketMapperMock,
                                            mock.BOLMapperMockFactory.BOLFileMapperMock,
                                            mock.DALMapperMockFactory.DALFileMapperMock);

            List <ApiFileResponseModel> response = await service.Files(default(int));

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