Esempio n. 1
0
        public void TestGetAvailableItemStatus()
        {
            ItemStatus CurrentItemStatus = new ItemStatus()
            {
                Code = "IN",
                Description = "New"
            };
            OrderStatus CurrentOrderStatus = new OrderStatus()
            {
                Code = "CO",
                Description = "New"
            };
            Product Item = new Product()
            {
                StyleNumber = ""
            };

            List<ItemStatus> statuses = new List<ItemStatus>();
            statuses.Add(new ItemStatus()
            {
                Code = "IV",
                Description = "Cancelled"
            });
            statuses.Add(new ItemStatus()
            {
                Code = "IZP",
                Description = "Ship"
            });
            statuses.Add(new ItemStatus()
            {
                Code = "IX",
                Description = "Not Available"
            });

            var mock = new Mock<IOrderStatusRepository>();
            mock.Setup(s => s.GetAvailableItemStatuses(CurrentItemStatus, CurrentOrderStatus, Item)).Returns(statuses);

            OrderStatusBLO bo = new OrderStatusBLO(mock.Object);
            List<ItemStatus> retVal = bo.GetAvailableItemStatus(CurrentItemStatus, CurrentOrderStatus, Item);
            Assert.IsTrue(retVal.Count > 0);
            Assert.IsTrue(retVal.FindAll(s => s.Code == "IZP").Count > 0);
        }
Esempio n. 2
0
 public List<ItemStatus> GetAvailableItemStatus(ItemStatus CurrentItemStatus, OrderStatus CurrentOrderStatus, Product Item)
 {
     return _repository.GetAvailableItemStatuses(CurrentItemStatus, CurrentOrderStatus, Item);
 }