Esempio n. 1
0
        public void StartEndDateTest_byType_LTO_CheckStartDate_using_GeneralMethod()
        {
            //Arrange
            string          action          = "StartDate";
            string          expectStartDate = "2019/09/03";
            DateTime        actinDate       = DateFC.YMD(expectStartDate);
            DateTime        currentDate     = DateTime.Now;
            SearchParameter parameter       = new SearchParameter()
            {
                Operate      = action,
                SchoolYear   = "20192020",
                PositionType = "LTO"
            };

            if (currentDate > actinDate)
            {
                expectStartDate = DateFC.YMD(currentDate, "/");
            }

            // Act
            var myDate = GeneralExe <LTODefalutDate> .myListOfT("StartEndDate", parameter)[0];

            var    startDate = myDate.StartDate;
            string expect    = expectStartDate;
            string result    = DateFC.YMD(startDate);

            //Assert
            Assert.AreEqual(expect, result, $"Start date Value  { result} ");
        }
Esempio n. 2
0
        public void TeachersListTest_Return_School_TeacherList_Searchby_Startwith_K_of_LastName_usingGeneralList()
        {
            //Arrange
            string action = "TeachersList";

            var myAnonymousParametere = new
            {
                SchoolYear   = "20192020",
                SchoolCode   = "0209",
                SearchValue1 = "K"
            };

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

            // Act
            string expect         = "Kurnik, Cassandra";
            int    expect2        = 202;
            string intitalValue   = "00045299"; // "kurnikc";
            object datasourceList = GeneralExe <TeachersListByCategory> .myListOfT(action, myAnonymousParametere);

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

            // Assert
            Assert.AreEqual(expect, result, $"Teacher List From School Select Value  { result}");
            Assert.AreEqual(expect2, result2, $"DD List Totle Count Value  { result2}");
        }
Esempio n. 3
0
        public void SchoolListTest_return_AllTCDSB_SchoolList_byaction_SPName()
        {
            //Arrange
            string action = "SchoolList";
            string spName = "dbo.tcdsb_LTO_PageGeneral_ListSchools @Operate,@Para0,@Para1,@Para2,@Para3";

            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 <ListSchool> .myListOfT(spName, 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}");
        }