Files
Musify/backend/Tests/Musify.Infrastructure.Tests/Jobs/RecurringJobsRegistrarTests.cs
T
Admin 2d0867e68a Add tests for MassTransit activities, routing slips, sagas, fault handling and playlist visibility
Infrastructure exposes its internals to the test project so the activities and slip builders can be
exercised directly, and the fault consumer and state machines run on the MassTransit test harness.
2026-09-24 12:53:33 +02:00

23 lines
653 B
C#

using Musify.Infrastructure.Jobs;
using Xunit;
namespace Musify.Infrastructure.Tests.Jobs;
public sealed class RecurringJobsRegistrarTests
{
[Theory]
[InlineData(1, "*/1 * * * *")]
[InlineData(59, "*/1 * * * *")]
[InlineData(60, "*/1 * * * *")]
[InlineData(61, "*/2 * * * *")]
[InlineData(300, "*/5 * * * *")]
[InlineData(3599, "0 */1 * * *")]
[InlineData(3600, "0 */1 * * *")]
[InlineData(7200, "0 */2 * * *")]
[InlineData(0, "*/1 * * * *")]
public void EveryCron_RoundsUpToWholeMinutes(int seconds, string expected)
{
Assert.Equal(expected, RecurringJobsRegistrar.EveryCron(seconds));
}
}