public void MapResponseToRequest() { var mapper = new ApiPaymentTypeModelMapper(); var model = new ApiPaymentTypeResponseModel(); model.SetProperties(1, "A"); ApiPaymentTypeRequestModel response = mapper.MapResponseToRequest(model); response.Name.Should().Be("A"); }
public async void TestUpdate() { var model = await this.CreateRecord(); ApiPaymentTypeModelMapper mapper = new ApiPaymentTypeModelMapper(); UpdateResponse <ApiPaymentTypeResponseModel> updateResponse = await this.Client.PaymentTypeUpdateAsync(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()); ApiPaymentTypeResponseModel model = await client.PaymentTypeGetAsync(1); ApiPaymentTypeModelMapper mapper = new ApiPaymentTypeModelMapper(); UpdateResponse <ApiPaymentTypeResponseModel> updateResponse = await client.PaymentTypeUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); }