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 ApiCustomerRequestModel(); createModel.SetProperties("B", "B", "B", "B"); CreateResponse <ApiCustomerResponseModel> createResult = await client.CustomerCreateAsync(createModel); createResult.Success.Should().BeTrue(); ApiCustomerResponseModel getResponse = await client.CustomerGetAsync(2); getResponse.Should().NotBeNull(); ActionResponse deleteResult = await client.CustomerDeleteAsync(2); deleteResult.Success.Should().BeTrue(); ApiCustomerResponseModel verifyResponse = await client.CustomerGetAsync(2); verifyResponse.Should().BeNull(); }
private async Task <ApiCustomerResponseModel> CreateRecord(ApiClient client) { var model = new ApiCustomerRequestModel(); model.SetProperties("B", DateTime.Parse("1/1/1988 12:00:00 AM"), 2, Guid.Parse("3842cac4-b9a0-8223-0dcc-509a6f75849b"), 1, 1); CreateResponse <ApiCustomerResponseModel> result = await client.CustomerCreateAsync(model); result.Success.Should().BeTrue(); return(result.Record); }
private async Task <ApiCustomerResponseModel> CreateRecord() { var model = new ApiCustomerRequestModel(); model.SetProperties("B", "B", "B", "B"); CreateResponse <ApiCustomerResponseModel> result = await this.Client.CustomerCreateAsync(model); result.Success.Should().BeTrue(); return(result.Record); }
public void MapModelToBO() { var mapper = new BOLCustomerMapper(); ApiCustomerRequestModel model = new ApiCustomerRequestModel(); model.SetProperties("A", "A", "A", "A"); BOCustomer response = mapper.MapModelToBO(1, model); response.Email.Should().Be("A"); response.FirstName.Should().Be("A"); response.LastName.Should().Be("A"); response.Phone.Should().Be("A"); }
public void MapRequestToResponse() { var mapper = new ApiCustomerModelMapper(); var model = new ApiCustomerRequestModel(); model.SetProperties("A", "A", "A", "A"); ApiCustomerResponseModel response = mapper.MapRequestToResponse(1, model); response.Email.Should().Be("A"); response.FirstName.Should().Be("A"); response.Id.Should().Be(1); response.LastName.Should().Be("A"); response.Phone.Should().Be("A"); }
public void MapModelToBO() { var mapper = new BOLCustomerMapper(); ApiCustomerRequestModel model = new ApiCustomerRequestModel(); model.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), 1, 1); BOCustomer response = mapper.MapModelToBO(1, model); response.AccountNumber.Should().Be("A"); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.PersonID.Should().Be(1); response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da")); response.StoreID.Should().Be(1); response.TerritoryID.Should().Be(1); }
public void CreatePatch() { var mapper = new ApiCustomerModelMapper(); var model = new ApiCustomerRequestModel(); model.SetProperties("A", "A", "A", "A"); JsonPatchDocument <ApiCustomerRequestModel> patch = mapper.CreatePatch(model); var response = new ApiCustomerRequestModel(); patch.ApplyTo(response); response.Email.Should().Be("A"); response.FirstName.Should().Be("A"); response.LastName.Should().Be("A"); response.Phone.Should().Be("A"); }
public void CreatePatch() { var mapper = new ApiCustomerModelMapper(); var model = new ApiCustomerRequestModel(); model.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), 1, 1); JsonPatchDocument <ApiCustomerRequestModel> patch = mapper.CreatePatch(model); var response = new ApiCustomerRequestModel(); patch.ApplyTo(response); response.AccountNumber.Should().Be("A"); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.PersonID.Should().Be(1); response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da")); response.StoreID.Should().Be(1); response.TerritoryID.Should().Be(1); }