public async void TestDelete() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); var createModel = new ApiPaymentTypeRequestModel(); createModel.SetProperties("B"); CreateResponse <ApiPaymentTypeResponseModel> createResult = await client.PaymentTypeCreateAsync(createModel); createResult.Success.Should().BeTrue(); ApiPaymentTypeResponseModel getResponse = await client.PaymentTypeGetAsync(2); getResponse.Should().NotBeNull(); ActionResponse deleteResult = await client.PaymentTypeDeleteAsync(2); deleteResult.Success.Should().BeTrue(); ApiPaymentTypeResponseModel verifyResponse = await client.PaymentTypeGetAsync(2); verifyResponse.Should().BeNull(); }
public void MapModelToBO() { var mapper = new BOLPaymentTypeMapper(); ApiPaymentTypeRequestModel model = new ApiPaymentTypeRequestModel(); model.SetProperties("A"); BOPaymentType response = mapper.MapModelToBO(1, model); response.Name.Should().Be("A"); }
private async Task <ApiPaymentTypeResponseModel> CreateRecord() { var model = new ApiPaymentTypeRequestModel(); model.SetProperties("B"); CreateResponse <ApiPaymentTypeResponseModel> result = await this.Client.PaymentTypeCreateAsync(model); result.Success.Should().BeTrue(); return(result.Record); }
public void MapRequestToResponse() { var mapper = new ApiPaymentTypeModelMapper(); var model = new ApiPaymentTypeRequestModel(); model.SetProperties("A"); ApiPaymentTypeResponseModel response = mapper.MapRequestToResponse(1, model); response.Id.Should().Be(1); response.Name.Should().Be("A"); }
public void CreatePatch() { var mapper = new ApiPaymentTypeModelMapper(); var model = new ApiPaymentTypeRequestModel(); model.SetProperties("A"); JsonPatchDocument <ApiPaymentTypeRequestModel> patch = mapper.CreatePatch(model); var response = new ApiPaymentTypeRequestModel(); patch.ApplyTo(response); response.Name.Should().Be("A"); }