예제 #1
0
        private int getNewRequestID(string positionType)
        {  //Arrange
            string action = "New";

            request.PositionType = positionType;

            string SP    = CommonExcute.SPNameAndParameters(SPFile, cPage, action);
            string newid = CommonExcute <PositionRequesting> .GeneralValue(SP, request);

            int x = Int32.Parse(newid);

            return(x);
        }
예제 #2
0
        public void CommonExcuteTest_PublishPosition_CreateNew_Return_NewID()
        {
            //Arrange
            string action = "New";

            testposition.Operate = action;

            string SP    = CommonExcute.SPNameAndParameters(SPFile, cPage, action);
            string newid = CommonExcute <PositionPublish> .GeneralValue(SP, testposition);

            int result = Int32.Parse(newid);

            Assert.IsNotNull(result, $"  Posting position new ID  { result}");
        }
예제 #3
0
        public void CommonExcuteTest_RequestPosting_CreateNewRequest_Return_NewID()
        {
            //Arrange
            string action = "New";

            request.Operate = action;

            string SP    = CommonExcute.SPNameAndParameters(SPFile, cPage, action);
            string newid = CommonExcute <PositionRequesting> .GeneralValue(SP, request);

            int result = Int32.Parse(newid);

            Assert.IsNotNull(result, $"  Posting request new ID  { result.ToString()}");
        }
예제 #4
0
        public void CommonExcuteTest_PublishPosition_CancelPublish_Return_Successfully()
        {
            //Arrange
            string action = "Cancel";

            testposition.Operate    = action;
            testposition.PositionID = 11532;

            //Act
            string expect = "Successfully";
            string SP     = CommonExcute.SPNameAndParameters(SPFile, cPage, action);
            string result = CommonExcute <PositionPublish> .GeneralValue(SP, testposition);

            //Assert
            Assert.AreEqual(expect, result, $" Cancel Posting position  { result}");
        }
예제 #5
0
        public void CommonExcuteTest_PublishPosition_Delete_Return_Successfully()
        {
            //Arrange
            string action = "Delete";
            int    ids    = getNewPostingID("LTO");

            testposition.Operate    = action;
            testposition.PositionID = ids;



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

            Assert.AreEqual(expect, result, $"  Re Posting position  { result}");
        }
예제 #6
0
        public void CommonExcuteTest_PublishPosition_Reposting_Return_Successfully()
        {
            //Arrange
            string action = "RePosting";
            int    ids    = getNewPostingID("LTO");

            testposition.Operate       = action;
            testposition.PositionID    = ids;
            testposition.PostingCycle  = "2";
            testposition.TakeApplicant = "No";

            string expect = (ids + 1).ToString(); //  "Successfully";
            string SP     = CommonExcute.SPNameAndParameters(SPFile, cPage, action);
            string result = CommonExcute <PositionPublish> .GeneralValue(SP, testposition);

            Assert.AreEqual(expect, result, $"  Re Posting position  { result}");
        }
예제 #7
0
        public void CommonExcuteTest_RequestPosting_CallBack_Return_Successfully()
        {
            //Arrange
            int    requestID = getNewRequestID("LTO");
            string action    = "Call Back";

            request.Operate    = action;
            request.PositionID = requestID;

            //Act
            string expect = "Successfully";
            string SP     = CommonExcute.SPNameAndParameters(SPFile, cPage, action);
            string result = CommonExcute <PositionRequesting> .GeneralValue(SP, request);

            //Assert
            Assert.AreEqual(expect, result, $" Cancel Posting position  { result}");
        }
예제 #8
0
        public void CommonExcuteTest_ApprovePosition_RejectRequest_Return_Successfully()
        {
            //Arrange
            string action    = "Reject";
            var    parameter = new PositionApprove()
            {
                Operate    = action,
                SchoolYear = "20192020",
                PositionID = 11532
            };
            //Act
            string expect = "Successfully";
            string SP     = CommonExcute.SPNameAndParameters(SPFile, cPage, action);
            string result = CommonExcute <PositionApprove> .GeneralValue(SP, parameter);

            //Assert
            Assert.AreEqual(expect, result, $" Reject Posting request on {parameter.PositionID}  { result}");
        }
예제 #9
0
        private int getNewPostingID(string positionType)
        {  //Arrange
            string action    = "New";
            var    parameter = new PositionPublish()
            {
                Operate      = action,
                SchoolYear   = schoolyear,
                PositionID   = 0,
                PositionType = positionType,
                SchoolCode   = "0549",
                UserID       = "mif"
            };
            string SP    = CommonExcute.SPNameAndParameters(SPFile, cPage, action);
            string newid = CommonExcute <PositionPublish> .GeneralValue(SP, parameter);

            int x = Int32.Parse(newid);

            return(x);
        }
예제 #10
0
        public void CommonExcuteTest_PublishPosition_Update_Return_Successfully()
        {
            //Arrange
            int    ids       = getNewPostingID("LTO");
            string action    = "Save";
            var    parameter = new PositionPublish()
            {
                Operate           = "Update",
                UserID            = "mif",
                SchoolYear        = "20182018",
                SchoolCode        = "0549",
                PositionID        = ids,
                PositionType      = "LTO",
                PositionTitle     = "Position Title for Test ",
                PositionLevel     = "BC012E",
                Qualification     = "",
                QualificationCode = "",
                Description       = "Posiition descriptiion for test",
                FTE              = 0.50M,
                FTEPanel         = "AM",
                StartDate        = "2018/09/03",
                EndDate          = "2019/06/30",
                DatePublish      = "2018/06/18",
                DateApplyOpen    = "2018/06/25",
                DateApplyClose   = "2018/06/27",
                Comments         = "Test posting comments",
                ReplaceTeacherID = "",
                ReplaceTeacher   = "",
                ReplaceReason    = "",
                OtherReason      = "",
                Owner            = "mif"
            };
            string expect = "Successfully";

            //Act

            string SP     = CommonExcute.SPNameAndParameters(SPFile, cPage, action);
            string result = CommonExcute <PositionPublish> .GeneralValue(SP, parameter);

            //Assert
            Assert.AreEqual(expect, result, $"  Update Posting position Content { result}");
        }
예제 #11
0
        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 }");
        }
예제 #12
0
        private int getNewRequestID(string positionType)
        {  //Arrange
            PositionRequesting request = new PositionRequesting()
            {
                Operate      = "New",
                SchoolYear   = "20192020",
                PositionID   = 0,
                PositionType = positionType,
                SchoolCode   = "0549",
                UserID       = "mif"
            };
            string action = "New";

            string SP    = CommonExcute.SPNameAndParameters(SPFile, "Request", action);
            string newid = CommonExcute <PositionRequesting> .GeneralValue(SP, request);

            int x = Int32.Parse(newid);

            return(x);
        }
예제 #13
0
        public void CommonExcuteTest_ApprovePosition_Save_Return_Successfully()
        {
            //Arrange
            int ids = 0;

            string action    = "Save";
            var    parameter = new PositionApprove()
            {
                Operate           = action,
                UserID            = "mif",
                SchoolYear        = schoolyear,
                SchoolCode        = "0549",
                PositionID        = ids,
                PositionType      = "LTO",
                PositionTitle     = "Position Title for Test ",
                PositionLevel     = "BC012E",
                Qualification     = "",
                QualificationCode = "",
                Description       = "Posiition descriptiion for test",
                FTE              = 0.50M,
                FTEPanel         = "AM",
                Comments         = "Test posting update function comments",
                StartDate        = "",
                EndDate          = "",
                Owner            = "mif",
                ReplaceTeacherID = "0000000"
            };
            string expect = "Successfully";

            //Act

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

            //Assert
            Assert.AreEqual(expect, result, $"  Update Posting position Content { result}");
        }
예제 #14
0
        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 }");
        }
예제 #15
0
        public string Update(object parameter)
        {
            string sp = PostingPositionExe.SPName("Update");

            return(CommonExcute <string> .GeneralValue(sp, parameter));
        }