Ejemplo n.º 1
0
        public void FindCategoryByIdTest()
        {
            IDatabase database = new Database(TestUtils.ConnString);
            Assert.NotNull(database);

            var categoryDao = new CategoryDao(database);
            InsertDummyData(categoryDao);
            Assert.Equal(items.Count, categoryDao.Count());

            Category myCateg = categoryDao.FindById(AKROBATIK_ID);
            Assert.NotNull(myCateg);
            Assert.Equal(AKROBATIK_LABEL, myCateg.Label);

            categoryDao.Delete(myCateg.Id);
            Assert.Equal(3, categoryDao.Count());
        }
Ejemplo n.º 2
0
        public void DeleteCategoryTest()
        {
            IDatabase database = new Database(TestUtils.ConnString);
            Assert.NotNull(database);

            var categoryDao = new CategoryDao(database);
            InsertDummyData(categoryDao);
            Assert.Equal(items.Count, categoryDao.Count());

            foreach(var item in items)
            {
                categoryDao.Delete(item.Id);
            }
            Assert.Equal(0, categoryDao.Count());
        }