Esempio n. 1
0
        public void AddRemoveBooks()
        {
            ShoppingCart SCart = new ShoppingCart();
              //Creation of 100 books
              for (int i = 0; i < 100; i++)
              {
            Book tmpBook = new Book(
            (100 * i), "TestBook", Guid.NewGuid().ToString(), "Harry", Book.SeriesEnum.HarryPotter);
            SCart.Items.Add(tmpBook);
              }
              Assert.AreEqual<int>(100, SCart.Count());

              //Add 20 copies
              SCart.AddToShoppingCart(Utils.GetSecondBook(), 20);
              Assert.AreEqual<int>(120, SCart.Count());
        }
Esempio n. 2
0
        public override object Clone()
        {
            var clonedObj = new Book(this.Price, this.Title, this.Isbn, this.Author, this.Series);

              return clonedObj;
        }