public void TestMethod8()
        {
            string bookISBN     = "21435362";
            string bookTitle    = "Bryce's Book";
            double bookPrice    = 25.99;
            int    bookQuantity = 1;
            string description  = "Bryce's Book";


            orderItem = new OrderItem(bookISBN, bookTitle, bookPrice, bookQuantity, description);

            // Method that is invoked by clicking the 'Add Book' button.
            bookOrder.AddItem(orderItem);

            bool expectedReturnWithBook = true;
            bool actualReturnWithBook   = bookOrder.HasItem(orderItem);

            // Method that is invoked by clicking the 'Remove Book' button.
            bookOrder.RemoveItem(orderItem.BookID);

            bool expectedReturnWithoutBook = false;
            bool actualReturnWithoutBook   = bookOrder.HasItem(orderItem);

            Assert.AreEqual(expectedReturnWithBook, actualReturnWithBook);
            Assert.AreEqual(expectedReturnWithoutBook, actualReturnWithoutBook);
        }
Exemple #2
0
        [TestMethod]//Add the book to order from available book window and check if the number of book in order equal to our expected value
        public void TestAddToOrder1()
        {
            uid = 9;
            String order_isbn      = "161729134";
            String order_title     = "NULLC## in Depth";
            double order_unitPrice = 41.22;
            int    quantity        = 2;
            int    expectedCount   = 1;

            bookOrder = new BookOrder();
            bookOrder.AddItem(new OrderItem(order_isbn, order_title, order_unitPrice, quantity));
            Assert.AreEqual(expectedCount, bookOrder.OrderItemList.Count);
        }