Exemplo n.º 1
0
        public void StockLogicTest()
        {
            LibraryLogic logic = new LibraryLogic(new Library());
            var          b     = new Book("Dune", "Herbert", BType.SciFi, 25, 1);

            logic.AddToStock(b);

            Assert.IsTrue(logic.GetLibrary.Stock.Contains(b));
            Assert.AreEqual(logic.GetLibrary.Stock.Count(), 1);
            Assert.IsTrue(logic.IsInStock(b));

            logic.AddToStock(b);
            Assert.AreEqual(logic.GetLibrary.Stock.Count(), 1);

            logic.RemoveFromStock(logic.GetLibrary.Stock[0]);
            Assert.AreEqual(logic.GetLibrary.Stock.Count(), 0);
        }