public void PublishOperationTest()
        {
            //Arrange
            var parameter = new PositionPublish()
            {
                Operate      = "New",
                SchoolYear   = schoolyear,
                PositionID   = 0,
                PositionType = "LTO",
                SchoolCode   = "0391",
                UserID       = "mif"
            };
            //Act
            string expect = "LTO";

            var newid = CommonOperationExcute.PublishOperation(parameter, "0");

            parameter.PositionID = Int32.Parse(newid);


            //Verify Act
            var result = CommonOperationExcute.PublishOperation(parameter, newid)[0];

            //Assert
            Assert.AreEqual(expect, result, $"  New LTO Posting position  { result}");
        }
        public void CommonOperationTest_For_Interview()
        {
            //Arrange
            var operation = new InterviewResult();

            operation.Operate    = "Update";
            operation.PositionID = "11220";
            operation.CPNum      = "00019270";
            var expect = "Successfully";
            //Act
            var result = CommonOperationExcute <InterviewResult> .CommonOperation(operation, "Update");

            //Assert
            Assert.AreEqual(expect, result, $"  Interview Update is { result}");
        }
        public void InterviewOperationTest_return_Successfully()
        {
            //Arrange
            InterviewResult operation = new InterviewResult();

            operation.Operate    = "Update";
            operation.PositionID = "11220";
            operation.CPNum      = "00019270";
            var expect = "Successfully";
            //Act
            var result = CommonOperationExcute.InterviewOperation(operation, operation.PositionID);

            //Assert
            Assert.AreEqual(expect, result, $"  Interview Update is { result}");
        }
        public void CommonExcuteTest_ApprovePosition_PostingForm100Request_Return_NewPostingNumber()
        {
            //Arrange
            string action    = "Posting";
            string source    = "Form100";
            var    parameter = new PositionApprove()
            {
                Operate           = action,
                UserID            = "mif",
                SchoolYear        = "20192020",
                PositionID        = 1660,
                SchoolCode        = "0239",
                Comments          = "Posting Comments",
                Description       = "Posting description",
                FTE               = 1.0M,
                FTEPanel          = "Full",
                StartDate         = "",
                EndDate           = "",
                Owner             = "frijiom",
                DatePublish       = "",
                DateApplyOpen     = "",
                DateApplyClose    = "",
                PositionLevel     = "BC708E",
                QualificationCode = "",
                Qualification     = "",
                CPNum             = "",
                RequestSource     = source,
                ReplaceTeacherID  = "Test Teacher",
            };

            string expect = "Successfully";
            string SP     = CommonExcute.SPNameAndParameters(SPFile, cPage, action);
            string result = CommonExcute <PositionApprove> .GeneralValue(SP, parameter);

            int positionID = Int32.Parse(result);

            parameter.PositionID = positionID;
            parameter.Operate    = "PostingNumber";
            string PostingNumber = CommonOperationExcute.ApproveOperation(parameter, "Property");

            Assert.AreEqual(expect, result, $"  REquest Posting position  New Posting Number { PostingNumber }");
        }
        public void CommonOperationTest_For_Publish()
        {
            //Arrange
            var parameter = new PositionPublish()
            {
                Operate       = "Save",
                SchoolYear    = schoolyear,
                PositionID    = 11568,
                PositionType  = "LTO",
                SchoolCode    = "0531",
                UserID        = "mif",
                Qualification = "English, French",
                PositionTitle = "New Test Class",
                PositionLevel = "BC708E"
            };
            var expect = "Successfully";
            //Act

            var result = CommonOperationExcute <PositionPublish> .CommonOperation(parameter, "Save");

            //Assert
            Assert.AreEqual(expect, result, $"  Interview Update is { result}");
        }
        public void CommonExcuteTest_ApprovePosition_PostingPrincipalRequest_Return_NewPostingNumber()
        {
            //Arrange
            int    requestid = getNewRequestID("LTO");
            string action    = "Posting";
            string source    = "Principal";
            var    parameter = new PositionApprove()
            {
                Operate    = action,
                UserID     = "mif",
                SchoolYear = schoolyear,
                SchoolCode = "0546",

                PositionID       = requestid,
                Comments         = "Posting comments",
                StartDate        = DateFC.YMD2(DateTime.Now.ToShortDateString()),
                EndDate          = DateFC.YMD2(DateTime.Now.ToShortDateString()),
                DatePublish      = DateFC.YMD2(DateTime.Now.ToShortDateString()),
                DateApplyOpen    = DateFC.YMD2(DateTime.Now.ToShortDateString()),
                DateApplyClose   = DateFC.YMD2(DateTime.Now.ToShortDateString()),
                CPNum            = "0000000",
                RequestSource    = source,
                ReplaceTeacherID = "00000000"
            };

            string expect = "Successfully";
            string SP     = CommonExcute.SPNameAndParameters(SPFile, cPage, action);
            string result = CommonExcute <PositionApprove> .GeneralValue(SP, parameter);

            int positionID = Int32.Parse(result);

            parameter.PositionID = positionID;
            parameter.Operate    = "PostingNumber";
            string PostingNumber = CommonOperationExcute.ApproveOperation(parameter, "Property");

            Assert.AreEqual(expect, result, $"  REquest Posting position  New Posting Number { PostingNumber }");
        }