public void MapResponseToRequest() { var mapper = new ApiKeyAllocationModelMapper(); var model = new ApiKeyAllocationResponseModel(); model.SetProperties("A", 1); ApiKeyAllocationRequestModel response = mapper.MapResponseToRequest(model); response.Allocated.Should().Be(1); }
public async void TestUpdate() { var model = await this.CreateRecord(); ApiKeyAllocationModelMapper mapper = new ApiKeyAllocationModelMapper(); UpdateResponse <ApiKeyAllocationResponseModel> updateResponse = await this.Client.KeyAllocationUpdateAsync(model.CollectionName, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); await this.Cleanup(); }
public void CreatePatch() { var mapper = new ApiKeyAllocationModelMapper(); var model = new ApiKeyAllocationRequestModel(); model.SetProperties(1); JsonPatchDocument <ApiKeyAllocationRequestModel> patch = mapper.CreatePatch(model); var response = new ApiKeyAllocationRequestModel(); patch.ApplyTo(response); response.Allocated.Should().Be(1); }