public void Cleanup() { if (ResolveMediator.ContainerBuilt) { ResolveMediator.Dispose(); } ScheduleMediator.Clear(); }
public void TestScheduleTimePoint_Error() { //清空调度任务 ScheduleMediator.Clear(); //开始调度,在当前时间2秒后执行 ScheduleMediator.Schedule(StubAlarmTask.Detail, DateTime.Now.AddSeconds(2)); Assert.IsNull(StubAlarmTask.ReferenceParam); }
public void Init() { if (!ResolveMediator.ContainerBuilt) { IServiceCollection builder = ResolveMediator.GetServiceCollection(); builder.RegisterConfigs(); ResolveMediator.Build(); } ScheduleMediator.Clear(); }
public void TestScheduleInspect_Error() { //清空调度任务 ScheduleMediator.Clear(); //清空参考系 StubShowTimeTask.ReferenceTimes.Clear(); //开始调度,每2秒执行一次 ScheduleMediator.ScheduleBySecond(StubShowTimeTask.Detail, 2); Assert.IsTrue(!StubShowTimeTask.ReferenceTimes.Any()); }
public void TestScheduleInspect() { //清空调度任务 ScheduleMediator.Clear(); //清空参考系 StubShowTimeTask.ReferenceTimes.Clear(); //开始调度,每2秒执行一次 ScheduleMediator.ScheduleBySecond(StubShowTimeTask.Detail, 2); //线程睡眠 Thread.Sleep(4100); Assert.IsTrue(StubShowTimeTask.ReferenceTimes.Count == 3); }