public void InSessionReturnsFalseWhenAfterWeekSpanningDaySession() { var session = new InstrumentSession { OpeningDay = DayOfTheWeek.Sunday, ClosingDay = DayOfTheWeek.Monday, OpeningTime = new TimeSpan(15, 0, 0), ClosingTime = new TimeSpan(15, 0, 0) }; //Tuesday, April 2 var dt = new DateTime(2014, 4, 2, 13, 0, 0); Assert.IsFalse(dt.InSession(session)); }
public void InSessionReturnsFalseWhenBeforeWeekSpanningDaySession() { var session = new InstrumentSession { OpeningDay = DayOfTheWeek.Sunday, ClosingDay = DayOfTheWeek.Monday, OpeningTime = new TimeSpan(15, 0, 0), ClosingTime = new TimeSpan(15, 0, 0) }; //Sunday, March 30 var dt = new DateTime(2014, 3, 30, 13, 0, 0); Assert.IsFalse(dt.InSession(session)); }
public void InSessionReturnsTrueWhenInsideWeekSpanningSessionInSecondWeek() { var session = new InstrumentSession { OpeningDay = DayOfTheWeek.Sunday, ClosingDay = DayOfTheWeek.Monday, OpeningTime = new TimeSpan(15, 0, 0), ClosingTime = new TimeSpan(15, 0, 0) }; //Monday, March 31 var dt = new DateTime(2014, 3, 31, 13, 0, 0); Assert.IsTrue(dt.InSession(session)); }
public void InSessionReturnsFalseWhenBeforeMultiDaySession() { var session = new InstrumentSession { OpeningDay = DayOfTheWeek.Monday, ClosingDay = DayOfTheWeek.Tuesday, OpeningTime = new TimeSpan(8, 0, 0), ClosingTime = new TimeSpan(15, 0, 0) }; //Monday, March 31 var dt = new DateTime(2014, 3, 31, 7, 0, 0); Assert.IsFalse(dt.InSession(session)); }
public void InSessionReturnsTrueWhenInsideMultiDaySession() { var session = new InstrumentSession { OpeningDay = DayOfTheWeek.Monday, ClosingDay = DayOfTheWeek.Tuesday, OpeningTime = new TimeSpan(8, 0, 0), ClosingTime = new TimeSpan(15, 0, 0) }; //Tuesday, April 1 var dt = new DateTime(2014, 4, 1, 7, 0, 0); Assert.IsTrue(dt.InSession(session)); }
public void InSessionReturnsFalseWhenAfterOneDaySessionOnNextDay() { var session = new InstrumentSession { OpeningDay = DayOfTheWeek.Monday, ClosingDay = DayOfTheWeek.Monday, OpeningTime = new TimeSpan(8, 0, 0), ClosingTime = new TimeSpan(15, 0, 0) }; //Tuesday, April 1 var dt = new DateTime(2014, 4, 1, 12, 30, 5); Assert.IsFalse(dt.InSession(session)); }
public void InSessionReturnsFalseWhenAfterOneDaySessionOnSameDay() { var session = new InstrumentSession { OpeningDay = DayOfTheWeek.Monday, ClosingDay = DayOfTheWeek.Monday, OpeningTime = new TimeSpan(8, 0, 0), ClosingTime = new TimeSpan(15, 0, 0) }; //Monday, March 31 var dt = new DateTime(2014, 3, 31, 16, 30, 5); Assert.IsFalse(dt.InSession(session)); }