public async void TestUpdate() { var model = await this.CreateRecord(); ApiTagsModelMapper mapper = new ApiTagsModelMapper(); UpdateResponse <ApiTagsResponseModel> updateResponse = await this.Client.TagsUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); await this.Cleanup(); }
public void MapResponseToRequest() { var mapper = new ApiTagsModelMapper(); var model = new ApiTagsResponseModel(); model.SetProperties(1, 1, 1, "A", 1); ApiTagsRequestModel response = mapper.MapResponseToRequest(model); response.Count.Should().Be(1); response.ExcerptPostId.Should().Be(1); response.TagName.Should().Be("A"); response.WikiPostId.Should().Be(1); }
public void CreatePatch() { var mapper = new ApiTagsModelMapper(); var model = new ApiTagsRequestModel(); model.SetProperties(1, 1, "A", 1); JsonPatchDocument <ApiTagsRequestModel> patch = mapper.CreatePatch(model); var response = new ApiTagsRequestModel(); patch.ApplyTo(response); response.Count.Should().Be(1); response.ExcerptPostId.Should().Be(1); response.TagName.Should().Be("A"); response.WikiPostId.Should().Be(1); }