Пример #1
0
        public void OrderForecastDetails_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _orderproposal_warehouse_replenishmentcycle = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };
            var _orderproposal_item_replenishmentcycle = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "68e95eb3-1f57-4e61-82ab-c5eeff2484acItem_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 9931,
                SupplierPackSize = 8703,
                InnerPackSize    = 8448,
                PalletType       = "Item_PalletType",
                PalTI            = 3011,
                PalHI            = 5370,
                UOM              = "Item_UOM",
            };
            var _orderproposal_orderforecast_orderforecastdetails = new DSS1_RetailerDriverStockOptimisation.BO.OrderForecast
            {
                ImportId  = 9967,
                Status    = "OrderForecast_Status",
                CreatedBy = "OrderForecast_CreatedBy",
                CreatedOn = now,
                StartDate = now,
                EndDate   = now,
                State     = "OrderForecast_State",
            };
            var _orderproposal_notification_orderforecastdetails = new DSS1_RetailerDriverStockOptimisation.BO.Notification
            {
                Message               = "Notification_Message",
                TotalSupplierStock    = 8630,
                OrderForecastQuantity = 3921,
                Diff = 1087,
                SalesForecastDate = now,
                CreatedBy         = "Notification_CreatedBy",
            };
            var _orderproposal_comments_orderforecastdetails = new DSS1_RetailerDriverStockOptimisation.BO.Comment
            {
                Text    = "Comment_Text",
                AddedBy = "Comment_AddedBy",
            };
            var _orderproposal_comments_orderforecastdetails2 = new DSS1_RetailerDriverStockOptimisation.BO.Comment
            {
                Text    = "Comment_Text",
                AddedBy = "Comment_AddedBy",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.OrderForecastDetails>(Session)
            .CheckProperty(p => p.ReplenishmentCycle, 8054)
            .CheckProperty(p => p.AutomatedForecast, 8786)
            .CheckProperty(p => p.Quantity, 2222222222.22222M)
            .CheckProperty(p => p.RecommendedOrderDate, now)
            .CheckProperty(p => p.SalesForecastDate, now)
            .CheckProperty(p => p.SupplierCanDeliver, true)
            .CheckProperty(p => p.SupplierMaxQuantity, 2222222222.22222M)
            .CheckProperty(p => p.SupplierCoverageDays, 9995)
            .CheckProperty(p => p.ItemCoverageDays, 1553)
            .CheckProperty(p => p.InitialStockLevel, 6286)
            .CheckProperty(p => p.SupplierAvailableQuantity, 6124)
            .CheckProperty(p => p.SupplierSharesStock, true)
            .CheckProperty(p => p.CreatedOn, now)
            .CheckProperty(p => p.Status, "OrderForecastDetails_Status")
            .CheckReference(p => p.Warehouse, _orderproposal_warehouse_replenishmentcycle)
            .CheckReference(p => p.Item, _orderproposal_item_replenishmentcycle)
            .CheckReference(p => p.OrderForecast, _orderproposal_orderforecast_orderforecastdetails)
            .CheckReference(p => p.Notification, _orderproposal_notification_orderforecastdetails)
            .CheckBag(p => p.Comments, (new List <DSS1_RetailerDriverStockOptimisation.BO.Comment>
            {
                _orderproposal_comments_orderforecastdetails,
                _orderproposal_comments_orderforecastdetails2
            }))
            .VerifyTheMappings();
        }
Пример #2
0
        public void Item_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _agreement_agreements_items = new DSS1_RetailerDriverStockOptimisation.BO.Agreement
            {
                FullTruckLoad       = true,
                AgreementDocument   = "Agreement_AgreementDocument",
                LeadTime            = "Agreement_LeadTime",
                DateCreated         = now,
                WDDeliveries        = true,
                TargetInventoryDays = 4750,
                Profile             = "Agreement_Profile",
            };
            var _agreement_agreements_items2 = new DSS1_RetailerDriverStockOptimisation.BO.Agreement
            {
                FullTruckLoad       = true,
                AgreementDocument   = "Agreement_AgreementDocument",
                LeadTime            = "Agreement_LeadTime",
                DateCreated         = now,
                WDDeliveries        = true,
                TargetInventoryDays = 6123,
                Profile             = "Agreement_Profile",
            };
            var _forecast_deliveryschedules_item = new DSS1_RetailerDriverStockOptimisation.BO.DeliverySchedule
            {
                LeadTime  = 2384,
                Weekday   = 2568,
                NameOfDay = "DeliverySchedule_NameOfDay",
                DBWeekday = 6397,
            };
            var _forecast_deliveryschedules_item2 = new DSS1_RetailerDriverStockOptimisation.BO.DeliverySchedule
            {
                LeadTime  = 8869,
                Weekday   = 4507,
                NameOfDay = "DeliverySchedule_NameOfDay",
                DBWeekday = 5241,
            };
            var _inventoryitem_inventoryitems_item = new DSS1_RetailerDriverStockOptimisation.BO.InventoryItem
            {
                CoverageDays = 4330,
                SafetyStock  = 2511,
                Status       = "InventoryItem_Status",
            };
            var _inventoryitem_inventoryitems_item2 = new DSS1_RetailerDriverStockOptimisation.BO.InventoryItem
            {
                CoverageDays = 9286,
                SafetyStock  = 1203,
                Status       = "InventoryItem_Status",
            };
            var _item_suppliercapacities_item = new DSS1_RetailerDriverStockOptimisation.BO.SupplierCapacity
            {
                DateOfStockUpdate = now,
                DailyProduction   = 2651,
                Stock             = 9044,
            };
            var _item_suppliercapacities_item2 = new DSS1_RetailerDriverStockOptimisation.BO.SupplierCapacity
            {
                DateOfStockUpdate = now,
                DailyProduction   = 5174,
                Stock             = 8303,
            };
            var _item_supplier_items = new DSS1_RetailerDriverStockOptimisation.BO.Supplier
            {
                Code = "Supplier_Code",
                Name = "Supplier_Name",
            };
            var _item_businessunit_item = new DSS1_RetailerDriverStockOptimisation.BO.BusinessUnit
            {
                Number      = 5353,
                Description = "BusinessUnit_Description",
            };
            var _item_category_item = new DSS1_RetailerDriverStockOptimisation.BO.Category
            {
                Number      = 6940,
                Description = "Category_Description",
            };
            var _item_subcategory_item = new DSS1_RetailerDriverStockOptimisation.BO.SubCategory
            {
                Number      = 2833,
                Description = "SubCategory_Description",
            };
            var _item_baseunit_item = new DSS1_RetailerDriverStockOptimisation.BO.BaseUnit
            {
                Number      = 988,
                Description = "BaseUnit_Description",
            };
            var _minimumquantity_minimumquantity_item = new DSS1_RetailerDriverStockOptimisation.BO.MinimumQuantity
            {
                Country  = "MinimumQuantity_Country",
                Quantity = 7287,
            };
            var _notification_notifications_item = new DSS1_RetailerDriverStockOptimisation.BO.Notification
            {
                Message               = "Notification_Message",
                TotalSupplierStock    = 2248,
                OrderForecastQuantity = 4736,
                Diff = 1992,
                SalesForecastDate = now,
                CreatedBy         = "Notification_CreatedBy",
            };
            var _notification_notifications_item2 = new DSS1_RetailerDriverStockOptimisation.BO.Notification
            {
                Message               = "Notification_Message",
                TotalSupplierStock    = 9495,
                OrderForecastQuantity = 8902,
                Diff = 4283,
                SalesForecastDate = now,
                CreatedBy         = "Notification_CreatedBy",
            };
            var _pastorder_pastorders_item = new DSS1_RetailerDriverStockOptimisation.BO.PastOrder
            {
                OrderNumber      = 9238,
                WrittenDate      = now,
                NotBeforeDate    = now,
                QuantityOrdered  = 4814,
                ReceiveDate      = now,
                QuantityReceived = 4466,
                Caller           = "PastOrder_Caller",
            };
            var _pastorder_pastorders_item2 = new DSS1_RetailerDriverStockOptimisation.BO.PastOrder
            {
                OrderNumber      = 1424,
                WrittenDate      = now,
                NotBeforeDate    = now,
                QuantityOrdered  = 4993,
                ReceiveDate      = now,
                QuantityReceived = 246,
                Caller           = "PastOrder_Caller",
            };
            var _sale_itemsforecast_item = new DSS1_RetailerDriverStockOptimisation.BO.Sales
            {
                ForecastDate = now,
                Units        = 1957,
            };
            var _sale_itemsforecast_item2 = new DSS1_RetailerDriverStockOptimisation.BO.Sales
            {
                ForecastDate = now,
                Units        = 1789,
            };
            var _sla_slaleadtimes_item = new DSS1_RetailerDriverStockOptimisation.BO.SLALeadTime
            {
                AgreedLeadTime    = 9208,
                RealLeadTime      = 324,
                Percentage        = 222222.22M,
                ItemDescription   = "SLALeadTime_ItemDescription",
                DateFormatted     = "SLALeadTime_DateFormatted",
                Threshold         = 222222.22M,
                SLALeadDate       = now,
                Month             = 1777,
                MonthlyDelayed    = 222222.22M,
                MontlhyOrders     = 222222.22M,
                MonthlyPercentage = 222222.22M,
            };
            var _sla_slaleadtimes_item2 = new DSS1_RetailerDriverStockOptimisation.BO.SLALeadTime
            {
                AgreedLeadTime    = 5943,
                RealLeadTime      = 7596,
                Percentage        = 222222.22M,
                ItemDescription   = "SLALeadTime_ItemDescription",
                DateFormatted     = "SLALeadTime_DateFormatted",
                Threshold         = 222222.22M,
                SLALeadDate       = now,
                Month             = 639,
                MonthlyDelayed    = 222222.22M,
                MontlhyOrders     = 222222.22M,
                MonthlyPercentage = 222222.22M,
            };
            var _sla_sladeliveries_item = new DSS1_RetailerDriverStockOptimisation.BO.SLADelivery
            {
                OrderedQuantities   = 222222.22M,
                DeliveredQuantities = 222222.22M,
                Percentage          = 222222.22M,
                ItemDescription     = "SLADelivery_ItemDescription",
                Threshold           = 222222.22M,
                SLADate             = now,
                DateFormatted       = "SLADelivery_DateFormatted",
                Month = 396,
            };
            var _sla_sladeliveries_item2 = new DSS1_RetailerDriverStockOptimisation.BO.SLADelivery
            {
                OrderedQuantities   = 222222.22M,
                DeliveredQuantities = 222222.22M,
                Percentage          = 222222.22M,
                ItemDescription     = "SLADelivery_ItemDescription",
                Threshold           = 222222.22M,
                SLADate             = now,
                DateFormatted       = "SLADelivery_DateFormatted",
                Month = 8494,
            };
            var _stockonhand_stocksonhand_item = new DSS1_RetailerDriverStockOptimisation.BO.StockOnHand
            {
                Units = 5008,
                CurrentInventoryDays = 222222.22M,
                StockOnHandDate      = now,
                LeadTime             = "StockOnHand_LeadTime",
                TargetInventoryDays  = 222222.22M,
                FullTrackLoad        = true,
                WDDays = true,
            };
            var _stockonhand_stocksonhand_item2 = new DSS1_RetailerDriverStockOptimisation.BO.StockOnHand
            {
                Units = 5380,
                CurrentInventoryDays = 222222.22M,
                StockOnHandDate      = now,
                LeadTime             = "StockOnHand_LeadTime",
                TargetInventoryDays  = 222222.22M,
                FullTrackLoad        = true,
                WDDays = true,
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.Item>(Session)
            .CheckProperty(p => p.SKU, "e9a08b5a-a00f-45b3-a68b-adb86cb8602cItem_SKU")
            .CheckProperty(p => p.Description, "Item_Description")
            .CheckProperty(p => p.UPC, "Item_UPC")
            .CheckProperty(p => p.AvgDailyDemand, 222222.22M)
            .CheckProperty(p => p.PalletSize, 9011)
            .CheckProperty(p => p.SupplierPackSize, 9480)
            .CheckProperty(p => p.InnerPackSize, 7252)
            .CheckProperty(p => p.PalletType, "Item_PalletType")
            .CheckProperty(p => p.PalTI, 7518)
            .CheckProperty(p => p.PalHI, 4266)
            .CheckProperty(p => p.UOM, "Item_UOM")
            .CheckBag(p => p.Agreements, (new List <DSS1_RetailerDriverStockOptimisation.BO.Agreement>
            {
                _agreement_agreements_items,
                _agreement_agreements_items2
            }))
            .CheckBag(p => p.DeliverySchedules, (new List <DSS1_RetailerDriverStockOptimisation.BO.DeliverySchedule>
            {
                _forecast_deliveryschedules_item,
                _forecast_deliveryschedules_item2
            }))
            .CheckBag(p => p.InventoryItems, (new List <DSS1_RetailerDriverStockOptimisation.BO.InventoryItem>
            {
                _inventoryitem_inventoryitems_item,
                _inventoryitem_inventoryitems_item2
            }))
            .CheckBag(p => p.SupplierCapacities, (new List <DSS1_RetailerDriverStockOptimisation.BO.SupplierCapacity>
            {
                _item_suppliercapacities_item,
                _item_suppliercapacities_item2
            }))
            .CheckReference(p => p.Supplier, _item_supplier_items)
            .CheckReference(p => p.BusinessUnit, _item_businessunit_item)
            .CheckReference(p => p.Category, _item_category_item)
            .CheckReference(p => p.SubCategory, _item_subcategory_item)
            .CheckReference(p => p.BaseUnit, _item_baseunit_item)
            .CheckReference(p => p.MinimumQuantity, _minimumquantity_minimumquantity_item)
            .CheckBag(p => p.Notifications, (new List <DSS1_RetailerDriverStockOptimisation.BO.Notification>
            {
                _notification_notifications_item,
                _notification_notifications_item2
            }))
            .CheckBag(p => p.PastOrders, (new List <DSS1_RetailerDriverStockOptimisation.BO.PastOrder>
            {
                _pastorder_pastorders_item,
                _pastorder_pastorders_item2
            }))
            .CheckBag(p => p.ItemsForecast, (new List <DSS1_RetailerDriverStockOptimisation.BO.Sales>
            {
                _sale_itemsforecast_item,
                _sale_itemsforecast_item2
            }))
            .CheckBag(p => p.SLALeadTimes, (new List <DSS1_RetailerDriverStockOptimisation.BO.SLALeadTime>
            {
                _sla_slaleadtimes_item,
                _sla_slaleadtimes_item2
            }))
            .CheckBag(p => p.SLADeliveries, (new List <DSS1_RetailerDriverStockOptimisation.BO.SLADelivery>
            {
                _sla_sladeliveries_item,
                _sla_sladeliveries_item2
            }))
            .CheckBag(p => p.StocksOnHand, (new List <DSS1_RetailerDriverStockOptimisation.BO.StockOnHand>
            {
                _stockonhand_stocksonhand_item,
                _stockonhand_stocksonhand_item2
            }))
            .VerifyTheMappings();
        }