Ejemplo n.º 1
0
        public async void Get_null_record()
        {
            var mock = new ServiceMockFacade <IPipelineStepRepository>();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <PipelineStep>(null));
            var service = new PipelineStepService(mock.LoggerMock.Object,
                                                  mock.RepositoryMock.Object,
                                                  mock.ModelValidatorMockFactory.PipelineStepModelValidatorMock.Object,
                                                  mock.BOLMapperMockFactory.BOLPipelineStepMapperMock,
                                                  mock.DALMapperMockFactory.DALPipelineStepMapperMock,
                                                  mock.BOLMapperMockFactory.BOLHandlerPipelineStepMapperMock,
                                                  mock.DALMapperMockFactory.DALHandlerPipelineStepMapperMock,
                                                  mock.BOLMapperMockFactory.BOLOtherTransportMapperMock,
                                                  mock.DALMapperMockFactory.DALOtherTransportMapperMock,
                                                  mock.BOLMapperMockFactory.BOLPipelineStepDestinationMapperMock,
                                                  mock.DALMapperMockFactory.DALPipelineStepDestinationMapperMock,
                                                  mock.BOLMapperMockFactory.BOLPipelineStepNoteMapperMock,
                                                  mock.DALMapperMockFactory.DALPipelineStepNoteMapperMock,
                                                  mock.BOLMapperMockFactory.BOLPipelineStepStepRequirementMapperMock,
                                                  mock.DALMapperMockFactory.DALPipelineStepStepRequirementMapperMock);

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

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }
Ejemplo n.º 2
0
        public async void TestDelete()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());

            var createModel = new ApiPipelineStepRequestModel();

            createModel.SetProperties("B", 1, 1);
            CreateResponse <ApiPipelineStepResponseModel> createResult = await client.PipelineStepCreateAsync(createModel);

            createResult.Success.Should().BeTrue();

            ApiPipelineStepResponseModel getResponse = await client.PipelineStepGetAsync(2);

            getResponse.Should().NotBeNull();

            ActionResponse deleteResult = await client.PipelineStepDeleteAsync(2);

            deleteResult.Success.Should().BeTrue();

            ApiPipelineStepResponseModel verifyResponse = await client.PipelineStepGetAsync(2);

            verifyResponse.Should().BeNull();
        }
Ejemplo n.º 3
0
        public async void TestGet()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());
            ApiPipelineStepResponseModel response = await client.PipelineStepGetAsync(1);

            response.Should().NotBeNull();
        }
Ejemplo n.º 4
0
        public async void TestGet()
        {
            ApiPipelineStepResponseModel response = await this.Client.PipelineStepGetAsync(1);

            response.Should().NotBeNull();
        }