Пример #1
0
        public async void Get_null_record()
        {
            var mock = new ServiceMockFacade <IPipelineStepDestinationRepository>();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <PipelineStepDestination>(null));
            var service = new PipelineStepDestinationService(mock.LoggerMock.Object,
                                                             mock.RepositoryMock.Object,
                                                             mock.ModelValidatorMockFactory.PipelineStepDestinationModelValidatorMock.Object,
                                                             mock.BOLMapperMockFactory.BOLPipelineStepDestinationMapperMock,
                                                             mock.DALMapperMockFactory.DALPipelineStepDestinationMapperMock);

            ApiPipelineStepDestinationResponseModel response = await service.Get(default(int));

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }
Пример #2
0
        public async void TestGet()
        {
            ApiPipelineStepDestinationResponseModel response = await this.Client.PipelineStepDestinationGetAsync(1);

            response.Should().NotBeNull();
        }