Esempio n. 1
0
        public void DefaultDateTest_return_runingDateValue_LTO()
        {
            //Arrange
            string          action    = "DefaultDate";
            SearchParameter parameter = new SearchParameter()
            {
                Operate      = action,
                SchoolYear   = "20192020",
                PositionType = "LTO"
            };


            // Act
            var myGridview = new System.Web.UI.WebControls.GridView();


            var myDate = GeneralExe.DefaultDate(parameter)[0];
            //myGridview.AutoGenerateColumns = true;
            //myGridview.DataSource = myDatasource;
            //myGridview.DataBind();

            var startDate   = myDate.StartDate;
            var endDate     = myDate.EndDate;
            var publishDate = myDate.DatePublish;
            var openDate    = myDate.DateApplyOpen;
            var closeDate   = myDate.DateApplyClose;

            string expect = DateFC.YMD(DateTime.Now);
            string result = DateFC.YMD(publishDate);

            //Assert
            Assert.AreEqual(expect, result, $"default publish Date Value  { result}");
        }
Esempio n. 2
0
        public void DefaultDateTest_return_runingDateValue_POP()
        {
            //Arrange
            string          action    = "DefaultDate";
            SearchParameter parameter = new SearchParameter()
            {
                Operate      = action,
                SchoolYear   = "20192020",
                PositionType = "POP"
            };

            // Act
            var myDate      = GeneralExe.DefaultDate(parameter)[0];
            var startDate   = myDate.StartDate;
            var endDate     = myDate.EndDate;
            var publishDate = myDate.DatePublish;
            var openDate    = myDate.DateApplyOpen;
            var closeDate   = myDate.DateApplyClose;

            string expect = DateFC.YMD(DateTime.Now);
            string result = DateFC.YMD(publishDate);

            //Assert
            Assert.AreEqual(expect, result, $"default publish Date Value  { result}");
        }
Esempio n. 3
0
        public void SearchListTest_return_List_byCategory_PostingState()
        {
            //Arrange
            string          action = "PostingState";
            SearchParameter search = new SearchParameter()
            {
                Operate      = action,
                SchoolYear   = "20192020",
                PositionType = "LTO",
                SearchType   = action
            };

            // Act
            var    testDDLControl = new System.Web.UI.WebControls.DropDownList();
            string expect         = "New Posting";
            int    expect2        = 9;
            string intitalValue   = "New Posting";
            object datasourceList = GeneralExe.SearchList(search);

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

            //Assert
            Assert.AreEqual(expect, result, $"Search by Posting State, Select Value  { result}");
            Assert.AreEqual(expect2, result2, $" Totel Posting state is   { result2}");
        }
Esempio n. 4
0
        public void ProfileTest_Return_Applicant_Role_using_GeneralMethod()
        {
            //Arrange
            string  action    = "UserRole";
            string  userid    = "antonim03";
            Profile parameter = new Profile()
            {
                Operate     = action,
                SchoolYear  = "20192020",
                ProfileType = action,
                CheckValue  = userid
            };

            // Act
            string expect = "Roster";
            string result = GeneralExe <string> .myValueOfT("Profile", parameter);

            /*
             * parameter.ProfileType = "CPNum";
             * int cpnum = GeneralExe<int>.myValueOfT("Profile", parameter);
             * parameter.ProfileType = "StartDate";
             * DateTime startDate = GeneralExe<DateTime>.myValueOfT("Profile", parameter);
             */
            //Assert
            Assert.AreEqual(expect, result, $" User Role is { result} from User ID: { userid } ");
        }
Esempio n. 5
0
        public void SchoolListTest_return_AllTCDSB_SchoolList_byDelegateMethod()
        {
            //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 <ListSchool> .myListofT_DelegateHelp_Method("Schools", 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}");
        }
Esempio n. 6
0
        public void StartEndDateTest_byType_POP_CheckStartDate()
        {
            //Arrange
            string          action          = "StartDate";
            string          expectStartDate = "2019/09/01";
            DateTime        actinDate       = DateFC.YMD(expectStartDate);
            DateTime        currentDate     = DateTime.Now;
            SearchParameter parameter       = new SearchParameter()
            {
                Operate      = action,
                SchoolYear   = "20192020",
                PositionType = "POP"
            };

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

            // Act
            var    myDate    = GeneralExe.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. 7
0
        public void RandomApplicantTest_Return_a_Random_applicant_LTOOnly_From_teacherLists()
        {
            //Arrange
            ApplicantRandom parameter = new ApplicantRandom()
            {
                Operate      = "Apply",
                SchoolYear   = "20192020",
                PositionID   = "0",
                PositionType = "LTO",
                PostingCycle = "1",
                CPNum        = "00000000"
            };

            //Act
            string expect = "1";

            List <Applicant> applicant1 = GeneralExe.RandomApplicant(parameter);

            string result = applicant1.Count.ToString();
            string rName  = applicant1[0].TeacherName;

            //Assert
            Assert.IsNotNull(result, $" Random Applicant is a { applicant1[0].ApplicantType } of { rName }");
            Assert.AreEqual(expect, result, $" Random Applicant is { rName }");

            parameter.CPNum        = applicant1[0].CPNum;
            parameter.PostingCycle = "3";
            List <Applicant> applicant2 = GeneralExe.RandomApplicant(parameter);
            string           result2    = applicant2.Count.ToString();
            string           rName2     = applicant2[0].TeacherName;

            //Assert2
            Assert.IsNotNull(result2, $" Random Applicant is a { applicant1[0].ApplicantType } of { rName2 }");
            Assert.AreEqual(expect, result2, $" Random Applicant is { rName2 }");
        }
Esempio n. 8
0
        private string Step6_ApplyOpenPosition_byApplicant_CPNum()
        {
            //Step 6  apply position

            //Arrange


            ApplicantRandom parameter = new ApplicantRandom()
            {
                Operate      = "Apply",
                SchoolYear   = _schoolYear,
                PositionID   = _positionId.ToString(),
                PositionType = "LTO",
                PostingCycle = "1",
                CPNum        = _cpNum
            };

            for (int i = 0; i < 10; i++)
            {
                List <Applicant> applicant = GeneralExe.RandomApplicant(parameter);
                string           cpnum     = applicant[0].CPNum;
                string           name      = applicant[0].TeacherName;
                string           userid    = applicant[0].UserID;
                Step6_ApplyOpenPosition_Action(cpnum, name, userid);
                parameter.CPNum = cpnum;
            }

            return("Successfully");
        }
Esempio n. 9
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. 10
0
        public void SPNameTest_Return_SPName_whatAction_Provide()
        {
            //Arrange
            string action = "dbo.tcdsb_LTO_anySPName @Operate,@Para0,@Para1,@Para2,@Para3";

            //Act
            string expect = action;
            string result = GeneralExe.SPName(action);

            //Assert
            Assert.AreEqual(expect, result, $" action provide Store Procedure Name and Parameters is:  { result}");
        }
Esempio n. 11
0
        public void SPNameTest_Return_SchoolList_SPName()
        {
            //Arrange
            string action = "Schools";

            //Act
            string expect = "dbo.tcdsb_LTO_PageGeneral_ListSchools @Operate,@Para0,@Para1,@Para2,@Para3";
            string result = GeneralExe.SPName(action);

            //Assert
            Assert.AreEqual(expect, result, $" School List Store Procedure Name  { result}");
        }
Esempio n. 12
0
        public void SPNameTest_Return_SchoolList_SPName_byDelegateHelpMethod()
        {
            //Arrange
            string action = "Schools";
            string page   = "General";
            //Act
            string expect = "dbo.tcdsb_LTO_PageGeneral_ListSchools @Operate,@Para0,@Para1,@Para2,@Para3";
            string result = GeneralExe.SPName(action, page);

            //Assert
            Assert.AreEqual(expect, result, $" action provide Store Procedure Name and Parameters is:  { result}");
        }
Esempio n. 13
0
        private string Step7_SelectInterviewCandidats()
        {
            // 7. Request a New Posting position
            //Arrange
            ParametersForOperation interviewcanddate = new ParametersForOperation()
            {
                Operate      = "SelectForInterview",
                SchoolYear   = _schoolYear,
                PositionID   = _positionId,
                PositionType = "LTO",
                SchoolCode   = _schoolCode,
                UserID       = "mif",
                CPNum        = _cpNum,
                Action       = "1"
            };

            ApplicantRandom random = new ApplicantRandom()
            {
                Operate      = "Candidate",
                SchoolYear   = _schoolYear,
                PositionID   = _positionId.ToString(),
                PositionType = "LTO",
                PostingCycle = "1",
                CPNum        = _cpNum
            };

            //Act
            string result = "1";

            for (int i = 0; i < 5; i++)
            {
                List <Applicant> applicant = GeneralExe.RandomApplicant(random);
                string           cpnum     = applicant[0].CPNum;
                random.CPNum            = applicant[0].CPNum;
                interviewcanddate.CPNum = applicant[0].CPNum;

                result = SelectCandidateExe.Selected(interviewcanddate);
            }

            string expect = "Successfully";

            //Assert
            Assert.IsNotNull(result, $" select interview candaitae.");


            return("Successfully");
        }
Esempio n. 14
0
        public void ValidateDateTest_Return_NextAvailable_WorkDay_whenPublicHailday_20191225()
        {
            //Arrange
            var checkDate = new
            {
                Operate      = "NextWorkDay",
                SchoolYear   = "20192020",
                PositionType = "LTO",
                ValidateDate = "2019/12/25"
            };

            //Act
            string expect = "2020/01/06";
            string result = GeneralExe.ValidateDate(checkDate);

            //Assert
            Assert.AreEqual(expect, result, $" Next work day is { result } for { checkDate.ValidateDate} is a Invaildate date. ");
        }
Esempio n. 15
0
        public void ValidateDateTest_Return_InVaildate_whenPublicHailday2_20191225()
        {
            //Arrange
            var checkDate = new
            {
                Operate      = "Check",
                SchoolYear   = "20192020",
                PositionType = "LTO",
                ValidateDate = "2019/12/25"
            };

            //Act
            string expect = "Invalid Date";
            string result = GeneralExe.ValidateDate(checkDate);

            //Assert
            Assert.AreEqual(expect, result, $" { checkDate.ValidateDate} is a Invaildate date. ");
        }
Esempio n. 16
0
        public void ValidateDateTest_Return_NextAvailable_WorkDay_whenWeekends_20191109()
        {
            //Arrange
            var checkDate = new
            {
                Operate      = "NextWorkDay",
                SchoolYear   = "20192020",
                PositionType = "LTO",
                ValidateDate = "2019/11/09"
            };

            //Act
            string expect = "2019/11/11";
            string result = GeneralExe.ValidateDate(checkDate);

            //Assert
            Assert.AreEqual(expect, result, $" Next work day is { result } for { checkDate.ValidateDate}");
        }
Esempio n. 17
0
        public void ValidateDateTest_Return_NextAvailable_WorkDaye_20191111()
        {
            //Arrange
            var checkDate = new
            {
                Operate      = "Check",
                SchoolYear   = "20192020",
                PositionType = "LTO",
                ValidateDate = "2019/11/11"
            };

            //Act
            string expect = checkDate.ValidateDate;
            string result = GeneralExe.ValidateDate(checkDate);

            //Assert
            Assert.AreEqual(expect, result, $" { result } is a next available work date for { checkDate.ValidateDate } . ");
        }
Esempio n. 18
0
        public void ProfileTest_Return_PostingNumber_byPositionID()
        {
            //Arrange
            string  action     = "PostingNumber";
            string  positinoID = "15586";
            Profile parameter  = new Profile()
            {
                Operate     = action,
                SchoolYear  = "20192020",
                ProfileType = action,
                CheckValue  = positinoID
            };

            // Act
            string expect = "2019-14595";
            string result = GeneralExe.Profile(parameter);

            //Assert
            Assert.AreEqual(expect, result, $"Posting Number is { result} from position ID: { positinoID } ");
        }
Esempio n. 19
0
        public void ProfileTest_Return_Pernr_Number_byUserCPNum()
        {
            //Arrange
            string  action    = "PernrNum";
            string  cpnum     = "00054071";
            Profile parameter = new Profile()
            {
                Operate     = action,
                SchoolYear  = "20192020",
                ProfileType = action,
                CheckValue  = cpnum
            };

            // Act
            string expect = "00062531";
            string result = GeneralExe.Profile(parameter);

            //Assert
            Assert.AreEqual(expect, result, $"Pernr Number is { result} from CPNum ID: { cpnum } ");
        }
Esempio n. 20
0
        public void ProfileTest_Return_Applicant_Role()
        {
            //Arrange
            string  action    = "UserRole";
            string  userid    = "antonim03";
            Profile parameter = new Profile()
            {
                Operate     = action,
                SchoolYear  = "20192020",
                ProfileType = action,
                CheckValue  = userid
            };

            // Act
            string expect = "Roster";
            string result = GeneralExe.Profile(parameter);

            //Assert
            Assert.AreEqual(expect, result, $" User Role is { result} from User ID: { userid } ");
        }
Esempio n. 21
0
        public void DDListNVTest_return_Elementary_panel_PositionLevel()
        {
            //Arrange
            string action = "PositionLevel";

            parameter.Operate = action;
            parameter.Para0   = "20192020";
            parameter.Para1   = "0204";
            parameter.Para2   = "0000";
            var testDDLControl = new System.Web.UI.WebControls.DropDownList();

            // Act
            string expect         = "Primary, Junior & Intermediate";
            string intitalValue   = "BC708E";
            object datasourceList = GeneralExe.DDListNV(parameter);

            AssemblingList.SetLists(testDDLControl, datasourceList, "Value", "Name", intitalValue);
            string result = testDDLControl.SelectedItem.Text;

            //Assert
            Assert.AreEqual(expect, result, $"DD List Select Value  { result}");
        }
Esempio n. 22
0
        public void TeacherNameTest_Return_Name_by_givingCPNum()
        {
            //Arrange
            string action       = "TeacherName";
            string intitalValue = "00045299"; // "CPNum";

            var myAnonymousParametere = new
            {
                CPNum   = intitalValue,
                Operate = "Name"
            };

            var testTextControl = new System.Web.UI.WebControls.TextBox();

            // Act
            string expect = "Cassandra Kurnik";

            testTextControl.Text = GeneralExe.TeacherName(myAnonymousParametere);
            string result = testTextControl.Text;

            // Assert
            Assert.AreEqual(expect, result, $"Teacher Name is { result} from CPNum {intitalValue} ");
        }
Esempio n. 23
0
        public void OpenCloseDateTest_ByType_Return_CheckCloseDate()
        {
            //Arrange
            string          action      = "OpenCloseDate";
            string          publishDate = "2019/10/8";
            SearchParameter parameter   = new SearchParameter()
            {
                Operate      = action,
                SchoolYear   = "20192020",
                PositionType = "LTO",
                DatePublish  = publishDate
            };

            // Act
            DateTime currentDate = DateTime.Now;
            var      myDate      = GeneralExe.OpenCloseDate(parameter)[0];
            var      openDate    = myDate.DateApplyOpen;
            var      closeDate   = myDate.DateApplyClose;
            string   expect      = "2019/10/10";
            string   result      = DateFC.YMD(closeDate);

            //Assert
            Assert.AreEqual(expect, result, $"Close date Value  { result} is  based on publish Date { publishDate} ");
        }