コード例 #1
0
        public void AddCatalogTest()
        {
            DataChamber           data   = new DataChamber();
            DefaultDataGeneration filler = new DefaultDataGeneration();
            DatabaseActions       test   = new DatabaseActions(data, filler);
            Catalog catalog = new Catalog("Andrzej", "Sapkowski", 2000, "The Witcher", 8);

            test.AddCatalog(catalog);

            Assert.AreEqual(test.ReadCatalog(8), catalog);
        }
コード例 #2
0
        public void DeleteCatalogTest()
        {
            DefaultDataGeneration filler = new DefaultDataGeneration();
            DataChamber           data   = new DataChamber();
            DatabaseActions       test   = new DatabaseActions(data, filler);
            Catalog newCatalog           = new Catalog("Lokok", "Test", 1908, "Testowy", 5);

            test.AddCatalog(newCatalog);
            Assert.AreEqual(test.ReadCatalog(5), newCatalog);

            test.DeleteCatalog(5);
            Assert.IsFalse(test.ReadAllCatalogs().ContainsValue(newCatalog));
        }