mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-06-02 05:04:14 -04:00
21 lines
585 B
C#
21 lines
585 B
C#
using API.Helpers.Converters;
|
|
using Xunit;
|
|
|
|
namespace API.Tests.Converters;
|
|
#nullable enable
|
|
public class CronConverterTests
|
|
{
|
|
[Theory]
|
|
[InlineData("daily", "0 0 * * *")]
|
|
[InlineData("disabled", "0 0 31 2 *")]
|
|
[InlineData("weekly", "0 0 * * 1")]
|
|
[InlineData("0 0 31 2 *", "0 0 31 2 *")]
|
|
[InlineData("sdfgdf", "sdfgdf")]
|
|
[InlineData("* * * * *", "* * * * *")]
|
|
[InlineData(null, "0 0 * * *")] // daily
|
|
public void ConvertTest(string? input, string expected)
|
|
{
|
|
Assert.Equal(expected, CronConverter.ConvertToCronNotation(input));
|
|
}
|
|
}
|