Esempio n. 1
0
        public void SchoolListTest_return_AllTCDSB_SchoolList()
        {
            //Arrange
            string action = "SchoolList";

            parameter.Operate = action;
            parameter.Para0   = "mif";
            parameter.Para1   = "admin";
            parameter.Para2   = "";
            parameter.Para3   = "20192020";

            var testDDLControl = new System.Web.UI.WebControls.DropDownList();

            // Act
            string expect         = "All Saints Catholic School";
            int    expect2        = 325;
            string intitalValue   = "0290";
            object datasourceList = GeneralExe.SchoolList(parameter);

            AssemblingList.SetLists(testDDLControl, datasourceList, "Code", "Name", intitalValue);
            string result  = testDDLControl.SelectedItem.Text;
            int    result2 = testDDLControl.Items.Count;

            // Assert
            Assert.AreEqual(expect, result, $"DD List Select Value  { result}");
            Assert.AreEqual(expect2, result2, $"DD List Totle Count Value  { result2}");
        }