예제 #1
0
        public void CatalogLogicTest()
        {
            LibraryLogic logic = new LibraryLogic(new Library());
            var          b     = new Book("Dune", "Herbert", BType.SciFi, 25, 1);

            logic.AddToCatalog(b);

            Assert.IsTrue(logic.GetLibrary.Catalog.Contains(b));
            Assert.IsTrue(logic.IsInCatalog(b));

            logic.AddToCatalog(b);
            Assert.AreEqual(logic.GetLibrary.Catalog.Count(), 1);

            logic.RemoveFromCatalog(logic.GetLibrary.Catalog[0]);
            Assert.AreEqual(logic.GetLibrary.Catalog.Count(), 0);
        }