using NordPool.Models;
namespace NordPool.Manager.Tests;
///
/// Shared, deterministic datasets used by the NordPool tests.
/// Keeping the generators here avoids copy-pasted price loops across test classes.
///
internal static class NordPoolTestData
{
public static readonly DateTime DayStart = new(2026, 3, 31, 0, 0, 0, DateTimeKind.Utc);
public static readonly DateTime TomorrowStart = DayStart.AddDays(1);
///
/// Builds a contiguous set of 15-minute intervals starting at .
///
public static List CreateIntervals(
int count,
Func priceFactory,
DateTime? dayStart = null)
{
var start = dayStart ?? DayStart;
return Enumerable.Range(0, count)
.Select(i => new NordPoolDayPrice
{
Start = start.AddMinutes(i * NordPoolConsts.MinutesPerInterval),
End = start.AddMinutes((i + 1) * NordPoolConsts.MinutesPerInterval),
Price = priceFactory(i)
})
.ToList();
}
///
/// A full 96-interval day with a deterministic sawtooth price curve covering
/// negative, zero, cheap and expensive prices.
///
public static List CreateGeneratedDay(DateTime? dayStart = null)
{
var start = dayStart ?? DayStart;
return CreateIntervals(
NordPoolConsts.MaxDailyIntervals,
i => Math.Round(15.0 * Math.Sin(i / 6.0) + (i % 8) - 2.0, 2),
start);
}
}