public void MapResponseToRequest() { var mapper = new ApiCountryModelMapper(); var model = new ApiCountryResponseModel(); model.SetProperties(1, "A"); ApiCountryRequestModel response = mapper.MapResponseToRequest(model); response.Name.Should().Be("A"); }
public async void TestUpdate() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); ApiCountryResponseModel model = await client.CountryGetAsync(1); ApiCountryModelMapper mapper = new ApiCountryModelMapper(); UpdateResponse <ApiCountryResponseModel> updateResponse = await client.CountryUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); }
public async void TestUpdate() { var model = await this.CreateRecord(); ApiCountryModelMapper mapper = new ApiCountryModelMapper(); UpdateResponse <ApiCountryResponseModel> updateResponse = await this.Client.CountryUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); await this.Cleanup(); }