Exemple #1
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 ApiPipelineStepStepRequirementRequestModel();

            createModel.SetProperties("B", 1, true);
            CreateResponse <ApiPipelineStepStepRequirementResponseModel> createResult = await client.PipelineStepStepRequirementCreateAsync(createModel);

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

            ApiPipelineStepStepRequirementResponseModel getResponse = await client.PipelineStepStepRequirementGetAsync(2);

            getResponse.Should().NotBeNull();

            ActionResponse deleteResult = await client.PipelineStepStepRequirementDeleteAsync(2);

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

            ApiPipelineStepStepRequirementResponseModel verifyResponse = await client.PipelineStepStepRequirementGetAsync(2);

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

            var client = new ApiClient(testServer.CreateClient());
            ApiPipelineStepStepRequirementResponseModel response = await client.PipelineStepStepRequirementGetAsync(1);

            response.Should().NotBeNull();
        }
        public async void Get_null_record()
        {
            var mock = new ServiceMockFacade <IPipelineStepStepRequirementRepository>();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <PipelineStepStepRequirement>(null));
            var service = new PipelineStepStepRequirementService(mock.LoggerMock.Object,
                                                                 mock.RepositoryMock.Object,
                                                                 mock.ModelValidatorMockFactory.PipelineStepStepRequirementModelValidatorMock.Object,
                                                                 mock.BOLMapperMockFactory.BOLPipelineStepStepRequirementMapperMock,
                                                                 mock.DALMapperMockFactory.DALPipelineStepStepRequirementMapperMock);

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

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }
Exemple #4
0
        public async void TestGet()
        {
            ApiPipelineStepStepRequirementResponseModel response = await this.Client.PipelineStepStepRequirementGetAsync(1);

            response.Should().NotBeNull();
        }