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