示例#1
0
 private void WhenABookIsAddedToTheCart()
 {
     _cart.AddBook(new Book
     {
         Author   = "SomeAuthor",
         Title    = "SomeTitle",
         BookType = BookType.Hardback,
         Price    = (decimal)4.99
     });
 }
示例#2
0
        public int ShoppingCartTest(int[] bookArray)
        {
            var target = new ShoppingCart();

            for (var i = 0; i < 5; i++)
            {
                if (bookArray[i] > 0)
                {
                    target.AddBook(_bookName[i], bookArray[i]);
                }
            }
            return(target.GetPrice());
        }
示例#3
0
 public void A_ShoppingCart_with_any_one_book_Price_is_8(int bookNumber)
 {
     SetUpEmptyCart();
     _myCart.AddBook(new Book(bookNumber));
     CartPriceInCentsShouldBe(BookPrice);
 }