public void MapResponseToRequest() { var mapper = new ApiSelfReferenceModelMapper(); var model = new ApiSelfReferenceResponseModel(); model.SetProperties(1, 1, 1); ApiSelfReferenceRequestModel response = mapper.MapResponseToRequest(model); response.SelfReferenceId.Should().Be(1); response.SelfReferenceId2.Should().Be(1); }
public async void TestUpdate() { var model = await this.CreateRecord(); ApiSelfReferenceModelMapper mapper = new ApiSelfReferenceModelMapper(); UpdateResponse <ApiSelfReferenceResponseModel> updateResponse = await this.Client.SelfReferenceUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); await this.Cleanup(); }
public async void TestUpdate() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); ApiSelfReferenceResponseModel model = await client.SelfReferenceGetAsync(1); ApiSelfReferenceModelMapper mapper = new ApiSelfReferenceModelMapper(); UpdateResponse <ApiSelfReferenceResponseModel> updateResponse = await client.SelfReferenceUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); }