fix: replace magic numbers with NordPoolConsts.MinutesPerInterval in compact price tests

Made-with: Cursor
This commit is contained in:
Marius
2026-03-19 16:17:47 +02:00
parent 3e5afa42c6
commit b926a8325e
@@ -1,6 +1,7 @@
using System.Text.Json; using System.Text.Json;
using FluentAssertions; using FluentAssertions;
using NordPool.Models; using NordPool.Models;
using static NordPool.Models.NordPoolConsts;
namespace NordPool.Manager.Tests; namespace NordPool.Manager.Tests;
@@ -9,7 +10,7 @@ public class CompactNordPoolDayPriceTests
private const int FifteenMinutesInSeconds = 900; private const int FifteenMinutesInSeconds = 900;
private static readonly DateTime TestStart = new(2026, 3, 19, 10, 0, 0, DateTimeKind.Utc); private static readonly DateTime TestStart = new(2026, 3, 19, 10, 0, 0, DateTimeKind.Utc);
private static readonly DateTime TestEnd = new(2026, 3, 19, 10, 15, 0, DateTimeKind.Utc); private static readonly DateTime TestEnd = TestStart.AddMinutes(MinutesPerInterval);
private static readonly long TestStartEpoch = new DateTimeOffset(TestStart).ToUnixTimeSeconds(); private static readonly long TestStartEpoch = new DateTimeOffset(TestStart).ToUnixTimeSeconds();
private static readonly long TestEndEpoch = new DateTimeOffset(TestEnd).ToUnixTimeSeconds(); private static readonly long TestEndEpoch = new DateTimeOffset(TestEnd).ToUnixTimeSeconds();
@@ -157,7 +158,7 @@ public class CompactNordPoolDayPriceTests
var prices = new List<NordPoolDayPrice> var prices = new List<NordPoolDayPrice>
{ {
new() { Start = TestStart, End = TestEnd, Price = 10.0 }, new() { Start = TestStart, End = TestEnd, Price = 10.0 },
new() { Start = TestEnd, End = TestEnd.AddMinutes(15), Price = 11.0 } new() { Start = TestEnd, End = TestEnd.AddMinutes(MinutesPerInterval), Price = 11.0 }
}; };
var result = prices.ToCompact(); var result = prices.ToCompact();