Exemple #1
0
        public async void All()
        {
            var mock    = new ServiceMockFacade <IFeedRepository>();
            var records = new List <Feed>();

            records.Add(new Feed());
            mock.RepositoryMock.Setup(x => x.All(It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult(records));
            var service = new FeedService(mock.LoggerMock.Object,
                                          mock.RepositoryMock.Object,
                                          mock.ModelValidatorMockFactory.FeedModelValidatorMock.Object,
                                          mock.BOLMapperMockFactory.BOLFeedMapperMock,
                                          mock.DALMapperMockFactory.DALFeedMapperMock);

            List <ApiFeedResponseModel> response = await service.All();

            response.Should().HaveCount(1);
            mock.RepositoryMock.Verify(x => x.All(It.IsAny <int>(), It.IsAny <int>()));
        }