Example #1
0
            public void TestMethodAddBook()
            {
                BookOrder bookOrder = new BookOrder();
                OrderItem orderItem;

                string bookISBN     = "8398230985";
                string bookTitle    = "Agile Software Development";
                double bookPrice    = 50.40;
                int    bookQuantity = 1;
                string description  = "sample description";

                // Creating a sample book entry
                orderItem = new OrderItem(bookISBN, bookTitle, bookPrice, bookQuantity, description);
                bookOrder.AddItem(orderItem);

                bool expectedReturnWithBook = true;

                //Checking if newly created item exists in orderItem
                bool actualReturnWithBook = bookOrder.HasItem(orderItem);

                Assert.AreEqual(expectedReturnWithBook, actualReturnWithBook);
            }
Example #2
0
            public void TestMethodAddBook2()
            {
                BookOrder bookOrder = new BookOrder();
                OrderItem orderItem;

                string bookISBN     = " ";
                string bookTitle    = "Comp Sci";
                double bookPrice    = 99.99;
                int    bookQuantity = 1;
                string description  = "sample description";

                // Creating a sample book entry
                orderItem = new OrderItem(bookISBN, bookTitle, bookPrice, bookQuantity, description);
                bookOrder.AddItem(orderItem);

                bool expectedReturnWithBook = false;

                //Checking if newly created item exists in orderItem
                bool actualReturnWithBook = bookOrder.HasItem(orderItem);

                Assert.AreEqual(expectedReturnWithBook, actualReturnWithBook);
            }