整理代码格式

This commit is contained in:
Falcon 2025-02-20 16:48:31 +08:00
parent 6092239b29
commit ace506c577
2 changed files with 226 additions and 225 deletions

View File

@ -1,4 +1,5 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Falcon.SugarApi.TimedBackgroundTask;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
namespace Falcon.SugarApi.Test
@ -12,10 +13,7 @@ namespace Falcon.SugarApi.Test
var cron = new CronExpression("0 30 3 * * 1-5"); // 工作日凌晨3:30:00
var nextTime = cron.GetNextOccurrence(now20250213102512);
if(nextTime == null) {
Assert.Fail("nextTime is null!");
return;
}
Assert.IsTrue(DateToString(nextTime) == "20250214033000");
cron = new CronExpression("");//下一秒触发
nextTime = cron.GetNextOccurrence(now20250213102512);

View File

@ -1,9 +1,10 @@
using Falcon.SugarApi;
using Falcon.SugarApi.TimedBackgroundTask;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Falcon.SugarApi.TimedBackgroundTask
{
/// <summary>
/// Cron表达式
/// </summary>
@ -240,3 +241,5 @@ public class CronExpression
throw new ArgumentException("提供的cron表达式错误",nameof(exp));
}
}
}