public void MapResponseToRequest() { var mapper = new ApiSalesOrderHeaderSalesReasonModelMapper(); var model = new ApiSalesOrderHeaderSalesReasonResponseModel(); model.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1); ApiSalesOrderHeaderSalesReasonRequestModel response = mapper.MapResponseToRequest(model); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.SalesReasonID.Should().Be(1); }
public async void TestUpdate() { var model = await this.CreateRecord(); ApiSalesOrderHeaderSalesReasonModelMapper mapper = new ApiSalesOrderHeaderSalesReasonModelMapper(); UpdateResponse <ApiSalesOrderHeaderSalesReasonResponseModel> updateResponse = await this.Client.SalesOrderHeaderSalesReasonUpdateAsync(model.SalesOrderID, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); await this.Cleanup(); }
public void CreatePatch() { var mapper = new ApiSalesOrderHeaderSalesReasonModelMapper(); var model = new ApiSalesOrderHeaderSalesReasonRequestModel(); model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), 1); JsonPatchDocument <ApiSalesOrderHeaderSalesReasonRequestModel> patch = mapper.CreatePatch(model); var response = new ApiSalesOrderHeaderSalesReasonRequestModel(); patch.ApplyTo(response); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.SalesReasonID.Should().Be(1); }