public void MapResponseToRequest() { var mapper = new ApiTagSetModelMapper(); var model = new ApiTagSetResponseModel(); model.SetProperties("A", BitConverter.GetBytes(1), "A", "A", 1); ApiTagSetRequestModel response = mapper.MapResponseToRequest(model); response.DataVersion.Should().BeEquivalentTo(BitConverter.GetBytes(1)); response.JSON.Should().Be("A"); response.Name.Should().Be("A"); response.SortOrder.Should().Be(1); }
public async void TestUpdate() { var model = await this.CreateRecord(); ApiTagSetModelMapper mapper = new ApiTagSetModelMapper(); UpdateResponse <ApiTagSetResponseModel> updateResponse = await this.Client.TagSetUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); await this.Cleanup(); }
public void CreatePatch() { var mapper = new ApiTagSetModelMapper(); var model = new ApiTagSetRequestModel(); model.SetProperties(BitConverter.GetBytes(1), "A", "A", 1); JsonPatchDocument <ApiTagSetRequestModel> patch = mapper.CreatePatch(model); var response = new ApiTagSetRequestModel(); patch.ApplyTo(response); response.DataVersion.Should().BeEquivalentTo(BitConverter.GetBytes(1)); response.JSON.Should().Be("A"); response.Name.Should().Be("A"); response.SortOrder.Should().Be(1); }