public void MapResponseToRequest() { var mapper = new ApiDestinationModelMapper(); var model = new ApiDestinationResponseModel(); model.SetProperties(1, 1, "A", 1); ApiDestinationRequestModel response = mapper.MapResponseToRequest(model); response.CountryId.Should().Be(1); response.Name.Should().Be("A"); response.Order.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()); ApiDestinationResponseModel model = await client.DestinationGetAsync(1); ApiDestinationModelMapper mapper = new ApiDestinationModelMapper(); UpdateResponse <ApiDestinationResponseModel> updateResponse = await client.DestinationUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); }
public async void TestUpdate() { var model = await this.CreateRecord(); ApiDestinationModelMapper mapper = new ApiDestinationModelMapper(); UpdateResponse <ApiDestinationResponseModel> updateResponse = await this.Client.DestinationUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); await this.Cleanup(); }