public void GetPresentationStringTestOneDateTime() { BLService_Accessor target = new BLService_Accessor(); string dayOfWeekCode = "1010100"; string[] startEndDateTimes = new string[] { "10/02/2010||10/02/2011||10:00||20:01" }; string expected = "[\"1\",\"0\",\"1\",\"0\",\"1\",\"0\",\"0\"],[\"10/02/2010\",\"10/02/2011\",\"10:00\",\"20:01\"]"; string actual; actual = target.GetPresentationString(dayOfWeekCode, startEndDateTimes); Assert.AreEqual(expected, actual); }
public void GetPresentationStringTestNoDateTime() { BLService_Accessor target = new BLService_Accessor(); string dayOfWeekCode = "1010100"; string[] startEndDateTimes = null; string expected = "[\"1\",\"0\",\"1\",\"0\",\"1\",\"0\",\"0\"]"; string actual; actual = target.GetPresentationString(dayOfWeekCode, startEndDateTimes); Assert.AreEqual(expected, actual); }
public void GetUserScheduleStringTestNoDateTime() { BLService_Accessor target = new BLService_Accessor(); string dayOfWeekCode = "1010100"; string[] startEndDateTimes = null; string expected = " and dayofweek = monday|| and dayofweek = wednesday|| and dayofweek = friday"; string actual; actual = target.GetScheduleString(dayOfWeekCode, startEndDateTimes); Assert.AreEqual(expected, actual); }
public void GetPresetnatonStringTestNoScheduleGiven() { BLService_Accessor target = new BLService_Accessor(); string dayOfWeekCode = "1010100"; string[] startEndDateTimes = null; string expected = @"[""1"",""0"",""1"",""0"",""1"",""0"",""0""]"; string actual; actual = target.GetPresentationString(dayOfWeekCode, startEndDateTimes); Assert.AreEqual(expected, actual); }
public void GetPresentationStringTestNoOneEndDateNoTimes() { BLService_Accessor target = new BLService_Accessor(); string dayOfWeekCode = "1010100"; string[] startEndDateTimes = new string[] { "10/01/2010||||||", "10/01/2010||10/02/2012||||" }; string expected = @"[""1"",""0"",""1"",""0"",""1"",""0"",""0""],[""10/01/2010"","""","""",""""],[""10/01/2010"",""10/02/2012"","""",""""]"; string actual; actual = target.GetPresentationString(dayOfWeekCode, startEndDateTimes); Assert.AreEqual(expected, actual); }
public void GetScheduleStringTestNoDaysOfWeek() { BLService_Accessor target = new BLService_Accessor(); string dayOfWeekCode = "0000000"; string[] startEndDateTimes = new string[] { "10/01/2010||10/02/2011||||", "10/01/2010||10/02/2012||||" }; string expected = ""; string actual; actual = target.GetScheduleString(dayOfWeekCode, startEndDateTimes); Assert.AreEqual(expected, actual); }
public void GetSimplePresentationStringNoDaysOfWeek() { BLService_Accessor target = new BLService_Accessor(); string startDate = "10/10/2010"; string endDate = ""; string startTime = ""; string endTime = "20:00"; string dayOfWeekCode = "0000000"; string expected = @"[""0"",""0"",""0"",""0"",""0"",""0"",""0""],[""10/10/2010"","""","""",""20:00""]"; string actual; actual = target.GetSimplePresentationString(startDate, endDate, startTime, endTime, dayOfWeekCode); Assert.AreEqual(expected, actual); }
public void GetSimpleDBStringTestOneDayOfWeekOnlyStartDate() { BLService_Accessor target = new BLService_Accessor(); string startDate = "10/10/2010"; string endDate = ""; string startTime = ""; string endTime = ""; string dayOfWeekCode = "0010000"; string expected = "date >= 10/10/2010 and dayofweek = wednesday"; string actual; actual = target.GetSimpleDBString(startDate, endDate, startTime, endTime, dayOfWeekCode); Assert.AreEqual(expected, actual); }
public void GetSimpleDBStringTestNoDaysOfWeek() { BLService_Accessor target = new BLService_Accessor(); string startDate = "10/10/2010"; string endDate = ""; string startTime = ""; string endTime = ""; string dayOfWeekCode = "0000000"; string expected = ""; string actual; actual = target.GetSimpleDBString(startDate, endDate, startTime, endTime, dayOfWeekCode); Assert.AreEqual(expected, actual); }
public void GetScheduleTestDaysOnly() { BLService_Accessor target = new BLService_Accessor(); string startDate = ""; string endDate = ""; string startTime = ""; string endTime = ""; string dayOfWeekCode = "0011000"; string schedule; string scheduleExpected = " and dayofweek = wednesday || and dayofweek = thursday"; string presentationSchedule; string presentationScheduleExpected = "[\"0\",\"0\",\"1\",\"1\",\"0\",\"0\",\"0\"],[\"\",\"\",\"\",\"\"]"; target.GetSimpleSchedule(startDate, endDate, startTime, endTime, dayOfWeekCode, out schedule, out presentationSchedule); Assert.AreEqual(scheduleExpected, schedule); Assert.AreEqual(presentationScheduleExpected, presentationSchedule); }
public void GetScheduleTestNothingFilledIn() { BLService_Accessor target = new BLService_Accessor(); string startDate = ""; string endDate = ""; string startTime = ""; string endTime = ""; string dayOfWeekCode = "0000000"; string schedule; string scheduleExpected = "time > 0000"; string presentationSchedule; string presentationScheduleExpected = "[\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\"],[\"" + System.DateTime.Now.ToShortDateString() + "\",\"" + System.DateTime.Now.AddYears(2).ToShortDateString() + "\",\"00:01\",\"23:59\"]"; target.GetSimpleSchedule(startDate, endDate, startTime, endTime, dayOfWeekCode, out schedule, out presentationSchedule); Assert.AreEqual(scheduleExpected, schedule); Assert.AreEqual(presentationScheduleExpected, presentationSchedule); }
public void GetScheduleTest() { BLService_Accessor target = new BLService_Accessor(); string startDate = ""; string endDate = ""; string startTime = "10:00"; string endTime = "20:00"; string dayOfWeekCode = "0100000"; string schedule; string scheduleExpected = " and time >= 1000 and time <= 2000 and dayofweek = tuesday"; string presentationSchedule; string presentationScheduleExpected = "[\"0\",\"1\",\"0\",\"0\",\"0\",\"0\",\"0\"],[\"\",\"\",\"10:00\",\"20:00\"]"; target.GetSimpleSchedule(startDate, endDate, startTime, endTime, dayOfWeekCode, out schedule, out presentationSchedule); Assert.AreEqual(scheduleExpected, schedule); Assert.AreEqual(presentationScheduleExpected, presentationSchedule); }
public void GetUserScheduleStringTestNoStartDateTimeNoEndDateTime() { BLService_Accessor target = new BLService_Accessor(); string dayOfWeekCode = "1010100"; string[] startEndDateTimes = new string[] { "10/01/2010||10/02/2011||20:00||", "10/01/2010||10/02/2011||||22:00" }; string expected = "date >= 10/01/2010 and date <= 10/02/2011 and time >= 2000 and dayofweek = monday ||" + " date >= 10/01/2010 and date <= 10/02/2011 and time <= 2200 and dayofweek = monday ||" + " date >= 10/01/2010 and date <= 10/02/2011 and time >= 2000 and dayofweek = wednesday ||" + " date >= 10/01/2010 and date <= 10/02/2011 and time <= 2200 and dayofweek = wednesday ||" + " date >= 10/01/2010 and date <= 10/02/2011 and time >= 2000 and dayofweek = friday ||" + " date >= 10/01/2010 and date <= 10/02/2011 and time <= 2200 and dayofweek = friday"; string actual; actual = target.GetScheduleString(dayOfWeekCode, startEndDateTimes); Assert.AreEqual(expected, actual); }
public void GetUserScheduleStringTest() { BLService_Accessor target = new BLService_Accessor(); string dayOfWeekCode = "1010100"; string[] startEndDateTimes = new string[] { "10/02/2010||10/02/2011||10:00||20:01", "06/11/2009||10/02/2015||09:30||12:01" }; string expected = "date >= 10/02/2010 and date <= 10/02/2011 and time >= 1000 and time <= 2001 and dayofweek = monday ||" + " date >= 06/11/2009 and date <= 10/02/2015 and time >= 0930 and time <= 1201 and dayofweek = monday ||" + " date >= 10/02/2010 and date <= 10/02/2011 and time >= 1000 and time <= 2001 and dayofweek = wednesday ||" + " date >= 06/11/2009 and date <= 10/02/2015 and time >= 0930 and time <= 1201 and dayofweek = wednesday ||" + " date >= 10/02/2010 and date <= 10/02/2011 and time >= 1000 and time <= 2001 and dayofweek = friday ||" + " date >= 06/11/2009 and date <= 10/02/2015 and time >= 0930 and time <= 1201 and dayofweek = friday"; string actual; actual = target.GetScheduleString(dayOfWeekCode, startEndDateTimes); Assert.AreEqual(expected, actual); }
public void GetSimpleDBStringTestNoStartEndTime() { BLService_Accessor target = new BLService_Accessor(); string startDate = "10/10/2010"; string endDate = "10/11/2011"; string startTime = ""; string endTime = ""; string dayOfWeekCode = "1111100"; string expected = "date >= 10/10/2010 and date <= 10/11/2011 and dayofweek = monday || " + "date >= 10/10/2010 and date <= 10/11/2011 and dayofweek = tuesday || " + "date >= 10/10/2010 and date <= 10/11/2011 and dayofweek = wednesday || " + "date >= 10/10/2010 and date <= 10/11/2011 and dayofweek = thursday || " + "date >= 10/10/2010 and date <= 10/11/2011 and dayofweek = friday"; string actual; actual = target.GetSimpleDBString(startDate, endDate, startTime, endTime, dayOfWeekCode); Assert.AreEqual(expected, actual); }