Exemplo n.º 1
0
        public async void All()
        {
            var mock    = new ServiceMockFacade <IPasswordRepository>();
            var records = new List <Password>();

            records.Add(new Password());
            mock.RepositoryMock.Setup(x => x.All(It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult(records));
            var service = new PasswordService(mock.LoggerMock.Object,
                                              mock.RepositoryMock.Object,
                                              mock.ModelValidatorMockFactory.PasswordModelValidatorMock.Object,
                                              mock.BOLMapperMockFactory.BOLPasswordMapperMock,
                                              mock.DALMapperMockFactory.DALPasswordMapperMock);

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

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