Exemplo n.º 1
0
        public async void DeploymentRelatedMachines_Not_Exists()
        {
            var mock = new ServiceMockFacade <IDeploymentRepository>();

            mock.RepositoryMock.Setup(x => x.DeploymentRelatedMachines(default(string), It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult <List <DeploymentRelatedMachine> >(new List <DeploymentRelatedMachine>()));
            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 <ApiDeploymentRelatedMachineResponseModel> response = await service.DeploymentRelatedMachines(default(string));

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