Ejemplo n.º 1
0
        public async void All()
        {
            var mock    = new ServiceMockFacade <IVotesRepository>();
            var records = new List <Votes>();

            records.Add(new Votes());
            mock.RepositoryMock.Setup(x => x.All(It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult(records));
            var service = new VotesService(mock.LoggerMock.Object,
                                           mock.RepositoryMock.Object,
                                           mock.ModelValidatorMockFactory.VotesModelValidatorMock.Object,
                                           mock.BOLMapperMockFactory.BOLVotesMapperMock,
                                           mock.DALMapperMockFactory.DALVotesMapperMock);

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

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