Ejemplo n.º 1
0
        protected void addButton_OnClick(object sender, EventArgs e)
        {
            SubCategory aSubCategory = new SubCategory();

            aSubCategory.SubCategoryName = subCategoryNameTextBox.Text;
            aSubCategory.CategoryId      = Convert.ToInt32(categoryDropDownList.SelectedItem.Value);
            messageLabel.ForeColor       = Color.Green;
            messageLabel.Text            = aBusinessLogic.AddSubCategory(aSubCategory);
            ClearSection();
        }
        public void AddSubCategoryTest()
        {
            SubCategory aSubCategory = new SubCategory
            {
                CategoryId      = 1,
                SubCategoryName = "Half Sleve Shirt"
            };
            string actual  = "Save SuccessFully";
            string predict = aProductBusinessLogic.AddSubCategory(aSubCategory);

            Assert.AreEqual(actual, predict);
        }