private async Task <ApiProductVendorResponseModel> CreateRecord() { var model = new ApiProductVendorRequestModel(); model.SetProperties(2, 2, 2m, DateTime.Parse("1/1/1988 12:00:00 AM"), 2, 2, DateTime.Parse("1/1/1988 12:00:00 AM"), 2, 2m, "B"); CreateResponse <ApiProductVendorResponseModel> result = await this.Client.ProductVendorCreateAsync(model); result.Success.Should().BeTrue(); return(result.Record); }
public void MapModelToBO() { var mapper = new BOLProductVendorMapper(); ApiProductVendorRequestModel model = new ApiProductVendorRequestModel(); model.SetProperties(1, 1, 1m, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1m, "A"); BOProductVendor response = mapper.MapModelToBO(1, model); response.AverageLeadTime.Should().Be(1); response.BusinessEntityID.Should().Be(1); response.LastReceiptCost.Should().Be(1m); response.LastReceiptDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.MaxOrderQty.Should().Be(1); response.MinOrderQty.Should().Be(1); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.OnOrderQty.Should().Be(1); response.StandardPrice.Should().Be(1m); response.UnitMeasureCode.Should().Be("A"); }
public void CreatePatch() { var mapper = new ApiProductVendorModelMapper(); var model = new ApiProductVendorRequestModel(); model.SetProperties(1, 1, 1m, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1m, "A"); JsonPatchDocument <ApiProductVendorRequestModel> patch = mapper.CreatePatch(model); var response = new ApiProductVendorRequestModel(); patch.ApplyTo(response); response.AverageLeadTime.Should().Be(1); response.BusinessEntityID.Should().Be(1); response.LastReceiptCost.Should().Be(1m); response.LastReceiptDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.MaxOrderQty.Should().Be(1); response.MinOrderQty.Should().Be(1); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.OnOrderQty.Should().Be(1); response.StandardPrice.Should().Be(1m); response.UnitMeasureCode.Should().Be("A"); }