Esempio n. 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();
        }
Esempio n. 2
0
        private async Task <ApiPipelineStepStepRequirementResponseModel> CreateRecord(ApiClient client)
        {
            var model = new ApiPipelineStepStepRequirementRequestModel();

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

            result.Success.Should().BeTrue();
            return(result.Record);
        }
        public void MapModelToBO()
        {
            var mapper = new BOLPipelineStepStepRequirementMapper();
            ApiPipelineStepStepRequirementRequestModel model = new ApiPipelineStepStepRequirementRequestModel();

            model.SetProperties("A", 1, true);
            BOPipelineStepStepRequirement response = mapper.MapModelToBO(1, model);

            response.Details.Should().Be("A");
            response.PipelineStepId.Should().Be(1);
            response.RequirementMet.Should().Be(true);
        }
        public void MapRequestToResponse()
        {
            var mapper = new ApiPipelineStepStepRequirementModelMapper();
            var model  = new ApiPipelineStepStepRequirementRequestModel();

            model.SetProperties("A", 1, true);
            ApiPipelineStepStepRequirementResponseModel response = mapper.MapRequestToResponse(1, model);

            response.Details.Should().Be("A");
            response.Id.Should().Be(1);
            response.PipelineStepId.Should().Be(1);
            response.RequirementMet.Should().Be(true);
        }
        public void CreatePatch()
        {
            var mapper = new ApiPipelineStepStepRequirementModelMapper();
            var model  = new ApiPipelineStepStepRequirementRequestModel();

            model.SetProperties("A", 1, true);

            JsonPatchDocument <ApiPipelineStepStepRequirementRequestModel> patch = mapper.CreatePatch(model);
            var response = new ApiPipelineStepStepRequirementRequestModel();

            patch.ApplyTo(response);
            response.Details.Should().Be("A");
            response.PipelineStepId.Should().Be(1);
            response.RequirementMet.Should().Be(true);
        }