public void MapResponseToRequest() { var mapper = new ApiCompositePrimaryKeyModelMapper(); var model = new ApiCompositePrimaryKeyResponseModel(); model.SetProperties(1, 1); ApiCompositePrimaryKeyRequestModel response = mapper.MapResponseToRequest(model); response.Id2.Should().Be(1); }
public async void TestUpdate() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); ApiCompositePrimaryKeyResponseModel model = await client.CompositePrimaryKeyGetAsync(1); ApiCompositePrimaryKeyModelMapper mapper = new ApiCompositePrimaryKeyModelMapper(); UpdateResponse <ApiCompositePrimaryKeyResponseModel> updateResponse = await client.CompositePrimaryKeyUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); }