📄 monthtimingtest.cs
字号:
using System;
using Lephone.Util.TimingTask;
using Lephone.Util.TimingTask.Timings;
using NUnit.Framework;
namespace Lephone.UnitTest.util.timingTask
{
[TestFixture]
public class MonthTimingTest
{
[Test]
public void TestIt()
{
MockNowTimeProvider ntp = new MockNowTimeProvider(new DateTime(2004,1,7,7,10,2,0));
ITiming t = new MonthTiming(new TimeOfDayStructure(8, 0, 0), 8, ntp);
Assert.AreEqual(false, t.TimesUp());
ntp.SetNow(new DateTime(2004,1,7,8,0,0,0));
Assert.AreEqual(false, t.TimesUp());
ntp.SetNow(new DateTime(2004,1,8,7,59,59,0));
Assert.AreEqual(false, t.TimesUp());
ntp.SetNow(new DateTime(2004,1,8,8,0,0,0));
Assert.AreEqual(true, t.TimesUp());
t.Reset();
Assert.AreEqual(false, t.TimesUp());
ntp.SetNow(new DateTime(2004,1,8,8,0,0,0));
Assert.AreEqual(false, t.TimesUp());
ntp.SetNow(new DateTime(2004,1,9,7,59,59,0));
Assert.AreEqual(false, t.TimesUp());
ntp.SetNow(new DateTime(2004,1,9,8,0,0,0));
Assert.AreEqual(false, t.TimesUp());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -