public DateTime YMDTest01(string eDate) { DateTime result = DateFC.YMD(eDate); return(result); // TODO: add assertions to method DateFCTest.YMDTest01(String) }
public string YMDStrTest(string vDate) { string result = DateFC.YMDStr(vDate); return(result); // TODO: add assertions to method DateFCTest.YMDStrTest(String) }
public string CurrentYearStringTest() { string result = DateFC.CurrentYearString(); return(result); // TODO: add assertions to method DateFCTest.CurrentYearStringTest() }
public string YMDTest02(DateTime vDate, string sign) { string result = DateFC.YMD(vDate, sign); return(result); // TODO: add assertions to method DateFCTest.YMDTest02(DateTime, String) }
private void Assemblies_Title() { string userID = User.Identity.Name; LabelSchoolyear.Text = DateFC.SchoolYearFrom("-", WorkingProfile.SchoolYear); LabelSchool.Text = WorkingProfile.SchoolName; LabelPrincipal.Text = WorkingProfile.SchoolPrincipal; LabelSuperintendent.Text = WorkingProfile.UserArea; hfSchoolcode.Value = WorkingProfile.SchoolCode; hfSchoolyear.Value = WorkingProfile.SchoolYear; hfUserRole.Value = WorkingProfile.UserRole; hfUserID.Value = User.Identity.Name; hfSignOff.Value = SignOff.Signature("Result", userID, WorkingProfile.UserRole, WorkingProfile.SchoolYear, WorkingProfile.SchoolCode, "School"); hfSignOffSO.Value = SignOff.Signature("Result", userID, WorkingProfile.UserRole, WorkingProfile.SchoolYear, WorkingProfile.SchoolCode, "SO"); hfPublish.Value = SignOff.Signature("Result", userID, WorkingProfile.UserRole, WorkingProfile.SchoolYear, WorkingProfile.SchoolCode, "Publish"); try { foreach (Control pControl in FormContent.Controls) { if (pControl is Label) { string code = pControl.ID.Replace("Label", ""); Label lbl = (Label)pControl; lbl.Text = FormData.Title(code); } } } catch (Exception ex) { var ms = ex.Message; } }
public void StartEndDateTest_byType_POP_CheckStartDate() { //Arrange string action = "StartDate"; string expectStartDate = "2019/09/01"; DateTime actinDate = DateFC.YMD(expectStartDate); DateTime currentDate = DateTime.Now; SearchParameter parameter = new SearchParameter() { Operate = action, SchoolYear = "20192020", PositionType = "POP" }; if (currentDate > actinDate) { expectStartDate = DateFC.YMD(currentDate, "/"); } // Act var myDate = GeneralExe.StartEndDate(parameter)[0]; var startDate = myDate.StartDate; string expect = expectStartDate; string result = DateFC.YMD(startDate); //Assert Assert.AreEqual(expect, result, $"Start date Value { result} "); }
public void LimitedDateTest_afterNewSchoolYearStart() { //Arrange var parameter = new LimitDate() { SchoolYear = schoolyear, PositionType = "LTO", Operate = "GetDefault", DatePublish = DateFC.YMD(DateTime.Now) }; int expect = 1; string expect1 = DateFC.YMD(DateTime.Now); string expect2 = "2019/06/28"; string expect3 = DateFC.YMD(getCloseDate(DateTime.Now.AddDays(2))); //Act var list = CommonListExecute.LimitedDate(parameter); int result = 1; int resultCount = list.Count; string result1 = list[0].StartDate; string result2 = list[0].EndDate; string result3 = list[0].DateApplyClose; //Assert Assert.AreEqual(expect1, result1, $" Default start Date is { result1}"); Assert.AreEqual(expect2, result2, $" Default End Date is { result2}"); Assert.AreEqual(expect3, result3, $" Default Close Date is { result3}"); Assert.AreEqual(expect, result, $" Default Datetime List is { result}"); Assert.IsTrue(resultCount >= 0, $" Default Datetime is { result}"); }
public string YearTOGOTest(string strType, string cSchoolYear) { string result = DateFC.YearTOGO(strType, cSchoolYear); return(result); // TODO: add assertions to method DateFCTest.YearTOGOTest(String, String) }
public void DefaultDateTest_return_runingDateValue_LTO() { //Arrange string action = "DefaultDate"; SearchParameter parameter = new SearchParameter() { Operate = action, SchoolYear = "20192020", PositionType = "LTO" }; // Act var myGridview = new System.Web.UI.WebControls.GridView(); var myDate = GeneralExe.DefaultDate(parameter)[0]; //myGridview.AutoGenerateColumns = true; //myGridview.DataSource = myDatasource; //myGridview.DataBind(); var startDate = myDate.StartDate; var endDate = myDate.EndDate; var publishDate = myDate.DatePublish; var openDate = myDate.DateApplyOpen; var closeDate = myDate.DateApplyClose; string expect = DateFC.YMD(DateTime.Now); string result = DateFC.YMD(publishDate); //Assert Assert.AreEqual(expect, result, $"default publish Date Value { result}"); }
public int AgeTest(DateTime BirthDate) { int result = DateFC.Age(BirthDate); return(result); // TODO: add assertions to method DateFCTest.AgeTest(DateTime) }
private void CreateReportandSaveToDB(string schoolYear, string schoolCode, string publishCycle, string GoalType, string schoolName, string schoolNameB) { string reportName = WebConfig.getValuebyKey("PublishDocumentName"); string userID = WorkingProfile.UserID; string publishDate = DateFC.YMD(DateTime.Now); Byte[] pdfReport = ReportRender.GetOneReport(reportName, userID, schoolYear, schoolCode, "1"); string result = PushToSP.PublishPLFtoSharePointSite("SLIP", pdfReport, schoolYear, schoolCode, schoolName, schoolNameB); // UploadFileToSharePointSite.PushToSite("SLIP", pdfReport, schoolYear, schoolCode, schoolName, schoolNameB); if (result == "Successful") { string action = btnReturn.Text; string signOffResult = SignOff.Signature2(action, userID, schoolYear, schoolCode, "Publish", publishDate); // SaveSLIPPublishDataToHistoryDirectory(schoolCode + ".PDF", pdfReport); errorlabel.Text = "The School PLF has been published to School Web site."; errorlabel.ForeColor = Color.Red; // PushToSP.SaveFileToHistoryFolder(WorkingProfile.SchoolYear, schoolCode + ".PDF", pdfReport); } else { errorlabel.Text = "The School PLF published failed to School Web site."; } }
public string FormatTest(DateTime pDate, string pFormat) { string result = DateFC.Format(pDate, pFormat); return(result); // TODO: add assertions to method DateFCTest.FormatTest(DateTime, String) }
public string SchoolYearPreviousTest(string strType, string cSchoolYear) { string result = DateFC.SchoolYearPrevious(strType, cSchoolYear); return(result); // TODO: add assertions to method DateFCTest.SchoolYearPreviousTest(String, String) }
private string Step8_NoticeCandidateToSchoolPrincipal() { //Arrange InterviewNotice interviewNotice = new InterviewNotice() { Operate = "Notice Update", UserID = "mif", SchoolYear = _schoolYear, PositionID = _positionId.ToString(), NoticeDate = DateFC.YMD(DateTime.Now), PrincipalID = _principalId }; //Act string expect = "Successfully"; string result = SelectCandidateExe.NoticeUpdate(interviewNotice); //Assert Assert.AreEqual(expect, result, $"Notice position { interviewNotice.PositionID } interview candiates to School Principal { _principalId } "); return("Successfully"); }
public string YMDTest(DateTime vDate) { string result = DateFC.YMD(vDate); return(result); // TODO: add assertions to method DateFCTest.YMDTest(DateTime) }
public int AgeTest01(DateTime birthdate, DateTime comparedate) { int result = DateFC.Age(birthdate, comparedate); return(result); // TODO: add assertions to method DateFCTest.AgeTest01(DateTime, DateTime) }
public void DefaultDateTest() { //Arrange string action = "DefaultDate"; SearchParameter parameter = new SearchParameter() { Operate = action, SchoolYear = "20192020", PositionType = "LTO" }; // Act List <PositionPublish> myDate = PublishPositionExe.DefaultDate(parameter); //myGridview.AutoGenerateColumns = true; //myGridview.DataSource = myDatasource; //myGridview.DataBind(); var startDate = myDate[0].StartDate; var endDate = myDate[0].EndDate; var publishDate = myDate[0].DatePublish; var openDate = myDate[0].DateApplyOpen; var closeDate = myDate[0].DateApplyClose; string expect = DateFC.YMD(DateTime.Now); string result = publishDate; //Assert Assert.AreEqual(expect, result, $"default publish Date Value { result}"); }
public void DefaultDateTest_return_runingDateValue_POP() { //Arrange string action = "DefaultDate"; SearchParameter parameter = new SearchParameter() { Operate = action, SchoolYear = "20192020", PositionType = "POP" }; // Act var myDate = GeneralExe.DefaultDate(parameter)[0]; var startDate = myDate.StartDate; var endDate = myDate.EndDate; var publishDate = myDate.DatePublish; var openDate = myDate.DateApplyOpen; var closeDate = myDate.DateApplyClose; string expect = DateFC.YMD(DateTime.Now); string result = DateFC.YMD(publishDate); //Assert Assert.AreEqual(expect, result, $"default publish Date Value { result}"); }
public void Date_Format_EnterDate_Return_MMDDYYYY_Test() { //Arrange string iDate = "12/08/2018"; DateTime tDate = Convert.ToDateTime(iDate); var expect = "12/08/2018"; // Act var result = DateFC.Format(tDate, "MMDDYYYY"); //Assert Assert.AreEqual(expect, result, $"Format the date in 12/08/2018, {result}"); }
protected void btnReturn_Click(object sender, EventArgs e) { string userID = User.Identity.Name; string schoolyear = Page.Request.QueryString["yID"]; string schoolcode = Page.Request.QueryString["sID"]; string signType = Page.Request.QueryString["tID"]; string action = btnReturn.Text; string vDate = DateFC.YMD(DateTime.Now); string signOffResult = SignOff.Signature2(action, userID, schoolyear, schoolcode, "Publish", vDate); CreateReportandSaveToDB(schoolyear, schoolcode, "1", "All", WorkingProfile.SchoolName, WorkingProfile.SchoolNameB); }
public void Date_Format_YMD_withLinkSignSlish_Test() { //Arrange string iDate = "12/08/2018"; DateTime tDate = Convert.ToDateTime(iDate); var expect = "2018/12/08"; // Act var result = DateFC.YMD(tDate, "/"); //Assert Assert.AreEqual(expect, result, $"Format the date YMD method 2018/12/08, {result}"); }
public void YearTOGOTest_Previous() { //Arrange string cschoolyear = "20182019"; string expect = "20172018"; // Act var result = DateFC.YearTOGO("Pre", 10, cschoolyear); //Assert Assert.AreEqual(expect, result, $"school year Go Previous, {result}"); }
public void YearTOGOTest_Next() { //Arrange string cschoolyear = "20182019"; string expect = "20192020"; // Act var result = DateFC.YearTOGO("Next", 10, cschoolyear); //Assert Assert.AreEqual(expect, result, $"school year Go Next, {result}"); }
public void SchoolYearPreviousTest() { //Arrange string cschoolyear = "20172018"; string expect = "2016-2017"; // Act var result = DateFC.SchoolYearPrevious("-", cschoolyear); //Assert Assert.AreEqual(expect, result, $"school year previous school year format, {result}"); }
public void SchoolYearNextTest() { //Arrange string cschoolyear = "20172018"; string expect = "2018-2019"; // Act var result = DateFC.SchoolYearNext("-", cschoolyear); //Assert Assert.AreEqual(expect, result, $"Next school year format, {result}"); }
public void Age_GetAgebyCurrentDate_Test() { //Arrange string iDate = "12/08/2010"; DateTime tDate = Convert.ToDateTime(iDate); string expect = "10"; // Act var result = DateFC.Age(tDate).ToString(); //Assert Assert.AreEqual(expect, result, $"Get Age by current date 8, {result}"); }
public void Age_GetAgebyGivenDate_Test() { //Arrange string iDate = "12/08/2005"; DateTime tDate = Convert.ToDateTime(iDate); string compaireDate = "2020/12/08"; DateTime tCompaireDate = Convert.ToDateTime(compaireDate); string expect = "15"; // Act var result = DateFC.Age(tDate, tCompaireDate).ToString(); //Assert Assert.AreEqual(expect, result, $"get Age by given date 15, {result}"); }
private string Step10_RecommendForHire() { // 10 Recommend one interview candidate for hire //Arrange //Arrange string result = ""; InterviewResult outcome = new InterviewResult() { Operate = "Recommend", SchoolYear = _schoolYear, PositionID = _positionId.ToString(), UserID = _principalId, CPNum = _cpNum, Acceptance = "1", OutCome = "6", // interview Recommendation = "Principal interview comments from full testing process interview step 9", InterviewDate = DateFC.YMD(DateTime.Now), EffectiveDate = DateFC.YMD(DateTime.Now), }; var parameter = new { Operate = "", SchoolYear = _schoolYear, PositionID = _positionId }; //Act string expect = "Successfully"; List <ApplicantListSelect> interviewlist = SelectCandidateExe.Applicants(parameter); foreach (ApplicantListSelect applicant in interviewlist) { string teachername = applicant.TeacherName; outcome.CPNum = applicant.CPNum; if (outcome.Acceptance == "1" && outcome.OutCome == "6") { result = InterviewProcessExe.Recommend(outcome); _hiredCpNum = outcome.CPNum; break; } } //Assert Assert.AreEqual(expect, result, $" Recommented for hire of { outcome.CPNum } "); return(result); }
private void Assemblies_Title() { string userID = User.Identity.Name; LabelSchoolyear.Text = DateFC.SchoolYearFrom("-", schoolYear); LabelSchool.Text = WorkingProfile.SchoolName; LabelPrincipal.Text = WorkingProfile.SchoolPrincipal; LabelSuperintendent.Text = WorkingProfile.UserAreaSuperintendent; hfSchoolcode.Value = schoolCode; hfSchoolyear.Value = schoolYear; hfUserRole.Value = WorkingProfile.UserRole; hfUserID.Value = User.Identity.Name; hfSignOff.Value = SignOff.Signature("Result", userID, "", schoolYear, schoolCode, "School"); hfSignOffSO.Value = SignOff.Signature("Result", userID, "", schoolYear, schoolCode, "SO"); hfPublish.Value = SignOff.Signature("Result", userID, "", schoolYear, schoolCode, "Publish"); hfComplete.Value = SignOff.Signature("Result", userID, "", schoolYear, schoolCode, "Complete"); }
private string Step11_ConfirmHire() { // 11. HR staff confirm hire //Arrange var parameter = new { SchoolYear = _schoolYear, PositionID = _positionId, CPNum = _hiredCpNum }; List <PositionHire> hirePositionlist = ConfirmHireExe.Position(parameter); PositionHire position = hirePositionlist[0]; //Act ParametersForOperationHire goHire = new ParametersForOperationHire() { Operate = "ConfirmHire", UserID = "mif", SchoolYear = _schoolYear, Comments = $"Auto testing Hired the person { position.TeacherName } to this { position.PositionTitle } by Full test process ", PositionID = position.PositionID, PositionType = position.PositionType, CPNum = _hiredCpNum, DateConfirm = DateFC.YMD(DateTime.Now), DateEffective = position.DateEffective, DateEnd = position.EndDate, Acceptance = "1", PrincipalEmail = "1", OfficerEmail = "0", PayStatus = "9", Action = "ConfirmHire" }; string result = ConfirmHireExe.Confirm(goHire); string expect = "Successfully"; //Assert Assert.AreEqual(expect, result, $"Hired { position.TeacherName } on { position.PositionTitle } . "); return("Successfully"); }