public void TestGetItemCategory_不存在的情况()
        {
            ItemCategoryFacade facade       = new ItemCategoryFacade();
            ItemCategoryInfo   categoryInfo = facade.GetItemCategoryById("50011665");

            #region 验证后置条件

            Assert.IsNull(categoryInfo);

            #endregion
        }
        public void TestGetItemCategory_已经存在的情况()
        {
            #region 验证前置条件

            ItemCategory category = new ItemCategory();
            category.Id         = "c2ecf0ef-dc5b-4308-9f38-047453d53919";
            category.CategoryId = "50011665";
            category.Name       = "测试类目";
            category.ParentId   = "0";
            category.IsParent   = true;
            category.SortOrder  = 1;
            category.Status     = "normal";
            ItemCategoryManager manager = new ItemCategoryManager();
            string sqlCreate            = manager.GetCreateSql(category);
            using (DbOperator dbOperator = new DbOperator(connString))
            {
                dbOperator.ExecSql(sqlCreate);
            }

            #endregion

            ItemCategoryFacade facade       = new ItemCategoryFacade();
            ItemCategoryInfo   categoryInfo = facade.GetItemCategoryById("50011665");

            #region 验证后置条件

            Assert.IsNotNull(categoryInfo);
            Assert.AreEqual("c2ecf0ef-dc5b-4308-9f38-047453d53919", categoryInfo.Id);
            Assert.AreEqual("50011665", categoryInfo.CategoryId);
            Assert.AreEqual("测试类目", categoryInfo.Name);
            Assert.AreEqual("0", categoryInfo.ParentId);
            Assert.AreEqual(true, categoryInfo.IsParent);
            Assert.AreEqual(1, categoryInfo.SortOrder);
            Assert.AreEqual("normal", categoryInfo.Status);

            #endregion
        }