public void UpdateTest_return_Successfully_check() { //Arrange var parameter = new ParametersForPosition() { SchoolYear = schoolyear, PositionID = getNewPublishID("LTO").ToString() }; var position = PublishPositionExe.Position(parameter)[0]; position.Operate = "Update"; position.SchoolYear = schoolyear; position.PositionTitle = "Test Grade 10 Teacher"; position.PositionLevel = "BC708E"; position.Description = " position descriptions from HR staff"; position.StartDate = "2019/09/03"; position.EndDate = "2020/06/30"; position.DatePublish = "2019/11/11"; position.DateApplyOpen = "2019/11/13"; position.DateApplyClose = "2019/11/15"; string expect = "Successfully"; //Act string result = PublishPositionExe.Update(position); //Assert Assert.AreEqual(expect, result, $" Postion update is { result} "); }
public List <PositionPublish> PositionTest(object parameter) { List <PositionPublish> result = PublishPositionExe.Position(parameter); return(result); // TODO: add assertions to method PublishPositionExeTest.PositionTest(Object) }
public void PositionInfoTest() { //Arrange var parameter = new ParametersForPosition() { SchoolYear = schoolyear, PositionID = getNewPublishID("LTO").ToString() }; var position = PublishPositionExe.Position(parameter)[0]; position.Operate = "Update"; position.SchoolYear = schoolyear; position.PositionTitle = "Test Grade 10 Teacher"; position.PositionLevel = "BC708E"; position.Description = " position descriptions from HR staff"; position.StartDate = "2019/09/03"; position.EndDate = "2020/06/30"; position.DatePublish = "2019/11/11"; position.DateApplyOpen = "2019/11/13"; position.DateApplyClose = "2019/11/15"; //Act string updateresult = PublishPositionExe.Update(position); List <PositionInfo> positionInfo = PublishPositionExe.PositionInfo(parameter); string expect = position.PositionTitle + "(" + parameter.PositionID + ")"; string expect2 = position.StartDate; string result = positionInfo[0].PositionTitle; string result2 = positionInfo[0].StartDate; //Assert Assert.AreEqual(expect, result, $" Position { parameter.PositionID } title is { result} "); Assert.AreEqual(expect2, result2, $" Position { parameter.PositionID } Apply open Date is { result2} "); }
public void PositionTest_return_publishPosition_by_giving_PositionID() { //Arrange var myGridview = new System.Web.UI.WebControls.GridView(); var parameter = new ParametersForPosition() { SchoolYear = schoolyear, PositionID = getNewPublishID("LTO").ToString() }; string expect = parameter.PositionID; //Act List <PositionPublish> publishList = PublishPositionExe.Position(parameter); myGridview.AutoGenerateColumns = true; myGridview.DataSource = publishList; myGridview.DataBind(); myGridview.SelectedIndex = 0; GridViewRow row = myGridview.SelectedRow; string result = row.Cells[14].Text; // PositionID in Gridview Cell position var result2 = publishList[0].PositionID; //Assert Assert.AreEqual(expect, result, $" Publish positions ID is { result } "); }
public void UpdateTest_createNewPublish_and_Update_Position_Return_Successfully() { //Arrange var parameter = new ParametersForPosition() { SchoolYear = "20192020", PositionID = getNewPublishID("LTO").ToString() }; var position = PublishPositionExe.Position(parameter)[0]; position.Operate = "Update"; position.SchoolYear = "20192020"; position.PositionTitle = "Test Grade 10 Teacher"; position.PositionLevel = "BC708E"; position.Description = " position descriptions from HR staff using interface method"; position.StartDate = "2019/09/03"; position.EndDate = "2020/06/30"; position.DatePublish = "2019/12/11"; position.DateApplyOpen = "2019/12/13"; position.DateApplyClose = "2019/12/15"; string expect = "Successfully"; //Act var testPosition = new Posting(new PostingPublish()); // IPostingPosition<string> testPosition = new PostingPublish<string>(); // var testList = testPosition.Update(parameter) .Position(parameter);// RequestPostingExe.Positions(parameter); string result = testPosition.Update(position); //Assert Assert.AreEqual(expect, result, $" Postion update is { result} "); }
public void CancelTest() { // Arrange var parameter = new ParametersForPosition() { SchoolYear = schoolyear, PositionID = getNewPublishID("LTO").ToString() }; var position = PublishPositionExe.Position(parameter)[0]; position.Operate = "Cancel"; //Act string result = PublishPositionExe.Cancel(position); string expect = "Successfully"; //Assert Assert.AreEqual(expect, result, $" { parameter.PositionID } has been cancel { 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 RePostingTest() { //Arrange var parameter = new ParametersForPosition() { SchoolYear = schoolyear, PositionID = getNewPublishID("LTO").ToString() }; var position = PublishPositionExe.Position(parameter)[0]; string prePostingCycle = position.PostingCycle; position.Operate = "RePosting"; position.UserID = "mif"; position.Comments = "Reposting from test process"; position.PostingCycle = "2"; string repostingID = PublishPositionExe.RePosting(position); parameter.PositionID = repostingID; var parameter2 = new ParametersForPosition() { SchoolYear = schoolyear, PositionID = repostingID }; var position2 = PublishPositionExe.Position(parameter2)[0]; string expect = position.PostingNumber; string result = position2.PostingNumber; string expect2 = prePostingCycle; string result2 = position2.PostingCycle; //Assert Assert.AreEqual(expect, result, $" { parameter.PositionID } reporting to { parameter2.PositionID} "); Assert.AreEqual(expect, result, $" { parameter.PositionID } posting Number is { expect} "); Assert.AreNotEqual(expect2, result2, $" { parameter.PositionID } posting Number is { expect} "); }
public void UpdateTest_using_reretive_update_result_value_ToVerify() { //Arrange var parameter = new ParametersForPosition() { SchoolYear = schoolyear, PositionID = getNewPublishID("LTO").ToString() }; var position = PublishPositionExe.Position(parameter)[0]; position.Operate = "Update"; position.SchoolYear = schoolyear; position.PositionTitle = "Test Grade 10 Teacher"; position.PositionLevel = "BC708E"; position.Description = " position descriptions from HR staff"; position.StartDate = "2019/09/03"; position.EndDate = "2020/06/30"; position.DatePublish = "2019/11/11"; position.DateApplyOpen = "2019/11/13"; position.DateApplyClose = "2019/11/15"; string expect = "Successfully"; string expect2 = "2019/11/15"; string expect3 = parameter.PositionID; //Act string result = PublishPositionExe.Update(position); var position2 = PublishPositionExe.Position(parameter)[0]; string result2 = position2.DateApplyClose; string result3 = position2.PositionID.ToString(); //Assert Assert.AreEqual(expect, result, $" Postion update is { result} "); Assert.AreEqual(expect2, result2, $" Check with apply cloase Date. Postion Apply close Date is { result2} "); Assert.AreEqual(expect3, result3, $" check with Position ID Position ID is { parameter.PositionID} "); }