public void MapResponseToRequest() { var mapper = new ApiPipelineStatuModelMapper(); var model = new ApiPipelineStatuResponseModel(); model.SetProperties(1, "A"); ApiPipelineStatuRequestModel response = mapper.MapResponseToRequest(model); response.Name.Should().Be("A"); }
public void CreatePatch() { var mapper = new ApiPipelineStatuModelMapper(); var model = new ApiPipelineStatuRequestModel(); model.SetProperties("A"); JsonPatchDocument <ApiPipelineStatuRequestModel> patch = mapper.CreatePatch(model); var response = new ApiPipelineStatuRequestModel(); patch.ApplyTo(response); response.Name.Should().Be("A"); }
public async void TestUpdate() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); ApiPipelineStatuResponseModel model = await client.PipelineStatuGetAsync(1); ApiPipelineStatuModelMapper mapper = new ApiPipelineStatuModelMapper(); UpdateResponse <ApiPipelineStatuResponseModel> updateResponse = await client.PipelineStatuUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); }