コード例 #1
0
        public void NewPostingTest_CreateNewPOPPublish()
        {
            //Arrange
            var parameter = new PositionPublish()
            {
                Operate      = "New",
                SchoolYear   = schoolyear,
                PositionID   = 0,
                PositionType = "POP",
                SchoolCode   = "0391",
                UserID       = "mif"
            };
            //Act
            string expect = "POP";

            var newid = PostingPublishExe.NewPosting(parameter, 0);

            var parameter1 = new ParametersForPosition()
            {
                SchoolYear = schoolyear,
                PositionID = newid,
            };

            //Verify Act
            var result = PostingPublishExe.Position(parameter1)[0].PositionType;

            //Assert
            Assert.AreEqual(expect, result, $"  New POP Posting position  { result}");
        }
コード例 #2
0
        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}");
        }
コード例 #3
0
        public void PostingRequestTest()
        {
            //Arrange
            var parameter = new PositionPublish()
            {
                Operate        = "Posted",
                UserID         = "mif",
                SchoolYear     = schoolyear,
                PositionID     = 1666,
                RequestSource  = "Form100",
                SchoolCode     = "0419",
                Comments       = "Post",
                StartDate      = "2019/04/18",
                EndDate        = "2019/05/27",
                DatePublish    = "2019/03/25",
                DateApplyOpen  = "2019/03/25",
                DateApplyClose = "2019/03/27",
                CPNum          = "00014614",
            };
            //  string expect = "Successfully";

            //Act
            var result = PostingApproveRequestExe.PostingRequest(parameter, 1666);

            //Assert
            //  Assert.AreEqual(expect, result, $"  Reject Posting Request e{ result}");
            Assert.IsNotNull(result, $"  Reject Posting Request e{ result}");
        }
コード例 #4
0
        private int getNewPostingID(string positionType)
        {
            var parameter = new PositionPublish()
            {
                Operate      = "New",
                SchoolYear   = schoolyear,
                PositionID   = 0,
                PositionType = positionType,
                SchoolCode   = "0549",
                UserID       = "mif"
            };
            string newid = PostingPublishExe.NewPosting(parameter, 0);
            int    x     = Int32.Parse(newid);

            return(x);
        }
コード例 #5
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);
        }
コード例 #6
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}");
        }
コード例 #7
0
        public void SavePostingTest()
        {
            //Arrange
            int ids       = getNewPostingID("LTO");
            var parameter = new PositionPublish()
            {
                Operate           = "Update",
                UserID            = "mif",
                SchoolYear        = "20182918",
                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
            var result = PostingPublishExe.SavePosting(parameter, ids);

            //Assert
            Assert.AreEqual(expect, result, $"  Update Posting position Content { result}");
        }
コード例 #8
0
        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}");
        }
コード例 #9
0
        public static string TestCount(PositionPublish position, int positonID)
        {
            var myval = new PostingPublish();

            return(myval.TestCount(position, positonID));
        }
コード例 #10
0
        public static string SavePosting(PositionPublish position, int positonID)
        {
            var myval = new PostingPublish();

            return(myval.SavePosting(position, positonID));
        }
コード例 #11
0
        public static string PostingRequest(PositionPublish operation, int positonID)
        {
            var myval = new PostingApproveRequest();

            return(myval.Posting(operation, positonID));
        }
コード例 #12
0
 public static string PublishOperation(PositionPublish operation, string action)
 {
     //  return CommonOperationExcute<PositionPublish>.CommonOperation(operation, action);
     return(Operation(operation, action));
 }