public void Category_Fetch()
        {
            Exception exception = null;

            var category = BusinessHelper.CreateCategoryAndLogon(
                CategoryTestsWithRoleContribute.UserName, CategoryTestsWithRoleContribute.UserPassword);

            try
            {
                CategoryService.CategoryFetch(category.CategoryId);
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            Assert.IsTrue(exception == null, "Exception should be null");
        }
        public void Category_Delete()
        {
            var category = BusinessHelper.CreateCategoryAndLogon(
                CategoryTestsWithRoleContribute.UserName, CategoryTestsWithRoleContribute.UserPassword);

            Exception exception = null;

            try
            {
                CategoryService.CategoryDelete(category.CategoryId);
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            Assert.IsTrue(exception != null, "Exception should not be null");
            Assert.IsTrue(exception.GetBaseException() is SecurityException);
        }
示例#3
0
        public void Category_Fetch_List()
        {
            Exception exception = null;

            BusinessHelper.CreateCategoryAndLogon(
                CategoryTestsWithRoleReview.UserName, CategoryTestsWithRoleReview.UserPassword);

            BusinessHelper.CreateCategoryAndLogon(
                CategoryTestsWithRoleReview.UserName, CategoryTestsWithRoleReview.UserPassword);

            try
            {
                CategoryService.CategoryFetchInfoList();
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            Assert.IsTrue(exception == null, "Exception should be null");
        }
        public void Category_Edit()
        {
            var category = BusinessHelper.CreateCategoryAndLogon(
                CategoryTestsWithRoleContribute.UserName, CategoryTestsWithRoleContribute.UserPassword);

            Exception exception = null;

            try
            {
                category = CategoryService.CategoryFetch(category.CategoryId);

                category.Name = DataHelper.RandomString(20);

                CategoryService.CategorySave(category);
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            Assert.IsTrue(exception != null, "Exception should not be null");
            Assert.IsTrue(exception.GetBaseException() is SecurityException);
        }