public void LunchBreakTest02_NowIsNotHoliday() { using (new PDateTimeContext.NowGet()) using (new ConsoleContext()) using (var sw = new StringWriter()) { Console.SetOut(sw); PDateTime.NowGet.Body = () => new DateTime(2011, 12, 19, 00, 00, 00); LifeInfo.Holiday(); Assert.AreEqual("曜日: Monday\tお仕事なう・・・" + sw.NewLine, sw.ToString()); } }
public void LunchBreakTest01_NowIsHoliday() { using (new PDateTimeContext.NowGet()) using (new ConsoleContext()) using (var sw = new StringWriter()) { Console.SetOut(sw); PDateTime.NowGet.Body = () => new DateTime(2011, 12, 18, 00, 00, 00); LifeInfo.Holiday(); Assert.Equal("曜日: Sunday\t休日なう!" + sw.NewLine, sw.ToString()); } }
static void Main(string[] args) { LifeInfo.LunchBreak(); LifeInfo.Holiday(); }