public void LimitedDateTest_BeforeNewSchoolYearStart() { //Arrange var parameter = new LimitDate() { SchoolYear = schoolyear, PositionType = "LTO", Operate = "GetDefault", DatePublish = "2018/06/10" }; int expect = 1; string expect1 = "2018/09/04"; string expect2 = "2019/06/28"; string expect3 = "2018/08/14"; // setup date in tcdsb_LTO_StartDatebyYear string expect4 = "2018/08/16"; // setup date in tcdsb_LTO_StartDatebyYear //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].DateApplyOpen; string result4 = 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 Open Date is { result3}"); Assert.AreEqual(expect4, result4, $" Default Close Date is { result3}"); Assert.AreEqual(expect, result, $" Default Datetime List is { result}"); Assert.IsTrue(resultCount >= 0, $" Default Datetime is { 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}"); }