Exemple #1
0
        public void Delete_Category()
        {
            CateogryDb obj    = new CateogryDb();
            bool       result = obj.Delete(2);

            Assert.AreEqual(true, result);
        }
Exemple #2
0
        public void GetCategory_By_CategoryId()
        {
            CateogryDb obj = new CateogryDb();
            string     actualCategoryName   = obj.GetById(1).CategoryName;
            string     expectedCategoryName = "Walk";

            Assert.AreEqual(expectedCategoryName, actualCategoryName);
        }
Exemple #3
0
        public void GetAllCategories()
        {
            CateogryDb obj           = new CateogryDb();
            int        actualCount   = obj.GetAll().Count;
            int        expectedCount = 2;

            Assert.AreEqual(expectedCount, actualCount);
        }
Exemple #4
0
        public void GetByIdTest()
        {
            CateogryDb obj = new CateogryDb();
            string     actualCategoryName   = obj.GetById(2).CategoryName;
            string     expectedCategoryName = "Walking";

            Assert.AreEqual(expectedCategoryName, actualCategoryName);
        }
Exemple #5
0
        public void AddCategory()
        {
            CateogryDb obj    = new CateogryDb();
            bool       result = obj.Add(
                new Category {
                CategoryName = "Running Test", CategoryId = 0
            });

            Assert.AreEqual(true, result);
        }
Exemple #6
0
 public CategoryController()
 {
     dao = new CateogryDb();
 }