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