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

            records.Add(new Deployment());
            mock.RepositoryMock.Setup(x => x.All(It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult(records));
            var service = new DeploymentService(mock.LoggerMock.Object,
                                                mock.RepositoryMock.Object,
                                                mock.ModelValidatorMockFactory.DeploymentModelValidatorMock.Object,
                                                mock.BOLMapperMockFactory.BOLDeploymentMapperMock,
                                                mock.DALMapperMockFactory.DALDeploymentMapperMock,
                                                mock.BOLMapperMockFactory.BOLDeploymentRelatedMachineMapperMock,
                                                mock.DALMapperMockFactory.DALDeploymentRelatedMachineMapperMock);

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

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