public string DeadlineTest(object parameter) { string result = PublishPositionExe.Deadline(parameter); return(result); // TODO: add assertions to method PublishPositionExeTest.DeadlineTest(Object) }
public void DeadlineTest_return_DeadlineDate_bygiveingPublishDate() { //Arrange var anonyParametere = new { SchoolYear = "20192020", DatePublish = "2019/11/11", PositionType = "LTO" }; //Act string result = PublishPositionExe.Deadline(anonyParametere); string expect = "2019/11/13"; //Assert Assert.AreEqual(expect, result, $" The deasline date is { result } for publish date {anonyParametere.DatePublish } "); }
private string Step4_PostingRequestandGetPositionID() { // 4. posting Request //Arrange var parameter = new { SchoolYear = _schoolYear, PositionID = _requestId.ToString() // create new request }; var parameterForDeadline = new { SchoolYear = _schoolYear, DatePublish = _publishDate, PositionType = "LTO" }; var requestPosition = PostingPositionExe.Position(parameter)[0]; // get the posting position requestPosition.Comments = "Posting school request post position test process"; requestPosition.CPNum = _cpNum; requestPosition.StartDate = _dateStart; requestPosition.EndDate = _dateEnd; requestPosition.DatePublish = _publishDate; requestPosition.DateApplyOpen = _applyDate; requestPosition.DateApplyClose = PublishPositionExe.Deadline(parameterForDeadline); //Act string postingPositionId = PostingPositionExe.Posting(requestPosition); // go for posting _positionId = _requestId = Int32.Parse(postingPositionId); var parameterForGetPostingNumber = new { Operate = "Get", PositionID = postingPositionId }; var result = PostingPositionExe.PostingNumber(parameterForGetPostingNumber); // get Published Position string expect = DateTime.Now.Year.ToString() + "-" + postingPositionId; //Assert Assert.AreEqual(expect, result, $"Posting Request {result }"); return("Successfully"); }
public void PostingNumberTest() { //Arrange var parameter = new { SchoolYear = "20192020", PositionID = GetNewRequestId("LTO").ToString() // create new request }; var parameterForDeadline = new { SchoolYear = "20192020", DatePublish = "2019/11/12", PositionType = "LTO" }; var requestPosition = PostingPositionExe.Position(parameter)[0]; // get the posting position requestPosition.Comments = "Posting school request post position test process"; requestPosition.CPNum = "00000000"; requestPosition.StartDate = "2019/09/03"; requestPosition.EndDate = "2020/06/30"; requestPosition.DatePublish = "2019/11/11"; requestPosition.DateApplyOpen = "2019/11/12"; requestPosition.DateApplyClose = PublishPositionExe.Deadline(parameterForDeadline); //Act string postingPositionId = PostingPositionExe.Posting(requestPosition); // go for posting var parameterForGetPostingNumber = new { Operate = "Get", PositionID = postingPositionId }; var result = PostingPositionExe.PostingNumber(parameterForGetPostingNumber); // get Published Position string expect = DateTime.Now.Year.ToString() + "-" + postingPositionId; //Assert Assert.AreEqual(expect, result, $"Posting Number is { result } "); }
public void PostingTest_return_PublishPositionID() { //Arrange var parameter = new { SchoolYear = "20192020", PositionID = GetNewRequestId("LTO").ToString() // create new request }; var parameterForDeadline = new { SchoolYear = "20192020", DatePublish = "2019/11/12", PositionType = "LTO" }; var requestPosition = PostingPositionExe.Position(parameter)[0]; // get the posting position requestPosition.Comments = "Posting school request post position test process"; requestPosition.CPNum = "00000000"; requestPosition.StartDate = "2019/09/03"; requestPosition.EndDate = "2020/06/30"; requestPosition.DatePublish = "2019/11/11"; requestPosition.DateApplyOpen = "2019/11/12"; requestPosition.DateApplyClose = PublishPositionExe.Deadline(parameterForDeadline); //Act string postingPositionId = PostingPositionExe.Posting(requestPosition); // go for posting var parameterFormPublishPosition = new { SchoolYear = "20192020", PositionID = postingPositionId }; var publishPosition = PublishPositionExe.Position(parameterFormPublishPosition)[0]; // get Published Position string expect = parameter.PositionID; string result = publishPosition.RequestID.ToString(); //Assert Assert.AreEqual(expect, result, $"position posted new position ID is { postingPositionId }. request ID is { result } "); }
public void SaveTest_return_successfully_Save_EditContent() { //Arrange var parameter = new { SchoolYear = "20192020", PositionID = GetNewRequestId("LTO").ToString() // create new request }; var parameterForDeadline = new { SchoolYear = "20192020", DatePublish = "2019/11/12", PositionType = "LTO" }; var requestPosition = PostingPositionExe.Position(parameter)[0]; // get the posting position requestPosition.Operate = "Save"; requestPosition.Comments = "Posting school request post position test process"; requestPosition.CPNum = "00000000"; requestPosition.StartDate = "2019/09/03"; requestPosition.EndDate = "2020/06/30"; requestPosition.DatePublish = "2019/11/11"; requestPosition.DateApplyOpen = "2019/11/12"; requestPosition.DateApplyClose = PublishPositionExe.Deadline(parameterForDeadline); requestPosition.Qualification = ""; requestPosition.QualificationCode = ""; requestPosition.FTE = 1.00M; requestPosition.FTEPanel = "Full"; //Act string result = PostingPositionExe.Save(requestPosition); string expect = "Successfully"; //Assert Assert.AreEqual(expect, result, $"Posting Edit save action for { parameter.PositionID } is { result }"); }