public void MapResponseToRequest() { var mapper = new ApiCountryRequirementModelMapper(); var model = new ApiCountryRequirementResponseModel(); model.SetProperties(1, 1, "A"); ApiCountryRequirementRequestModel response = mapper.MapResponseToRequest(model); response.CountryId.Should().Be(1); response.Details.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()); ApiCountryRequirementResponseModel model = await client.CountryRequirementGetAsync(1); ApiCountryRequirementModelMapper mapper = new ApiCountryRequirementModelMapper(); UpdateResponse <ApiCountryRequirementResponseModel> updateResponse = await client.CountryRequirementUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); }
public async void TestUpdate() { var model = await this.CreateRecord(); ApiCountryRequirementModelMapper mapper = new ApiCountryRequirementModelMapper(); UpdateResponse <ApiCountryRequirementResponseModel> updateResponse = await this.Client.CountryRequirementUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); await this.Cleanup(); }