public virtual ApiPurchaseOrderDetailResponseModel MapBOToModel(
            BOPurchaseOrderDetail boPurchaseOrderDetail)
        {
            var model = new ApiPurchaseOrderDetailResponseModel();

            model.SetProperties(boPurchaseOrderDetail.PurchaseOrderID, boPurchaseOrderDetail.DueDate, boPurchaseOrderDetail.LineTotal, boPurchaseOrderDetail.ModifiedDate, boPurchaseOrderDetail.OrderQty, boPurchaseOrderDetail.ProductID, boPurchaseOrderDetail.PurchaseOrderDetailID, boPurchaseOrderDetail.ReceivedQty, boPurchaseOrderDetail.RejectedQty, boPurchaseOrderDetail.StockedQty, boPurchaseOrderDetail.UnitPrice);

            return(model);
        }
Ejemplo n.º 2
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiPurchaseOrderDetailModelMapper();
            var model  = new ApiPurchaseOrderDetailResponseModel();

            model.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1m, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, 1, 1, 1, 1, 1m);
            ApiPurchaseOrderDetailRequestModel response = mapper.MapResponseToRequest(model);

            response.DueDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.LineTotal.Should().Be(1m);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.OrderQty.Should().Be(1);
            response.ProductID.Should().Be(1);
            response.PurchaseOrderDetailID.Should().Be(1);
            response.ReceivedQty.Should().Be(1);
            response.RejectedQty.Should().Be(1);
            response.StockedQty.Should().Be(1);
            response.UnitPrice.Should().Be(1m);
        }