public void MapResponseToRequest() { var mapper = new ApiProxyModelMapper(); var model = new ApiProxyResponseModel(); model.SetProperties("A", "A", "A"); ApiProxyRequestModel response = mapper.MapResponseToRequest(model); response.JSON.Should().Be("A"); response.Name.Should().Be("A"); }
public async void TestUpdate() { var model = await this.CreateRecord(); ApiProxyModelMapper mapper = new ApiProxyModelMapper(); UpdateResponse <ApiProxyResponseModel> updateResponse = await this.Client.ProxyUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); await this.Cleanup(); }
public void CreatePatch() { var mapper = new ApiProxyModelMapper(); var model = new ApiProxyRequestModel(); model.SetProperties("A", "A"); JsonPatchDocument <ApiProxyRequestModel> patch = mapper.CreatePatch(model); var response = new ApiProxyRequestModel(); patch.ApplyTo(response); response.JSON.Should().Be("A"); response.Name.Should().Be("A"); }