Exemple #1
0
        public void LoadTest()
        {
            OrderItemList orderItems = new OrderItemList();

            orderItems.LoadByOrderId(1);

            int expected = 3;
            int actual   = orderItems.Count;

            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void DeleteTest()
        {
            OrderItemList orderItems = new OrderItemList();

            orderItems.LoadByOrderId(-99);

            //Find the order with the description testingorder
            OrderItem orderItem = orderItems.FirstOrDefault(f => f.Quantity == -98);

            //Delete it
            int result = orderItem.Delete();

            Assert.IsTrue(result == 1);
        }
Exemple #3
0
        public void UpdateTest()
        {
            OrderItemList orderItems = new OrderItemList();

            orderItems.LoadByOrderId(-99);

            //Find the order with the description testingorder
            OrderItem orderItem = orderItems.FirstOrDefault(o => o.Quantity == -99);

            //Update it and insert it
            orderItem.Quantity = -98;
            int result = orderItem.Update();

            Assert.IsTrue(result == 1);
        }