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 ApiPipelineStepStatuRequestModel();

            createModel.SetProperties("B");
            CreateResponse <ApiPipelineStepStatuResponseModel> createResult = await client.PipelineStepStatuCreateAsync(createModel);

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

            ApiPipelineStepStatuResponseModel getResponse = await client.PipelineStepStatuGetAsync(2);

            getResponse.Should().NotBeNull();

            ActionResponse deleteResult = await client.PipelineStepStatuDeleteAsync(2);

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

            ApiPipelineStepStatuResponseModel verifyResponse = await client.PipelineStepStatuGetAsync(2);

            verifyResponse.Should().BeNull();
        }
        private async Task <ApiPipelineStepStatuResponseModel> CreateRecord(ApiClient client)
        {
            var model = new ApiPipelineStepStatuRequestModel();

            model.SetProperties("B");
            CreateResponse <ApiPipelineStepStatuResponseModel> result = await client.PipelineStepStatuCreateAsync(model);

            result.Success.Should().BeTrue();
            return(result.Record);
        }
Ejemplo n.º 3
0
        public void MapModelToBO()
        {
            var mapper = new BOLPipelineStepStatuMapper();
            ApiPipelineStepStatuRequestModel model = new ApiPipelineStepStatuRequestModel();

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

            response.Name.Should().Be("A");
        }
        public void MapRequestToResponse()
        {
            var mapper = new ApiPipelineStepStatuModelMapper();
            var model  = new ApiPipelineStepStatuRequestModel();

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

            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
        }
        public void CreatePatch()
        {
            var mapper = new ApiPipelineStepStatuModelMapper();
            var model  = new ApiPipelineStepStatuRequestModel();

            model.SetProperties("A");

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

            patch.ApplyTo(response);
            response.Name.Should().Be("A");
        }