public void FindsCorrectTariff(Tariff[] tariff, DateTime dateTime, int idx) { Tariff?t = EPEXSPOT.FindTariff(tariff, dateTime); Assert.NotNull(t); Assert.Equal(tariff[idx].Timestamp, t?.Timestamp); }
public void ValidatesArguments() { Assert.Throws <ArgumentOutOfRangeException>(() => { var t = EPEXSPOT.FindTariff( new Tariff[] { new Tariff(new DateTime(2021, 12, 29, 13, 00, 00), 0, 0) }, new DateTime(2021, 12, 29, 12, 00, 00, DateTimeKind.Unspecified)); }); }
public void HandlesEmpty() { var t = EPEXSPOT.FindTariff(Array.Empty <Tariff>(), new DateTime(2021, 12, 29, 12, 00, 00, DateTimeKind.Utc)); Assert.Null(t); }
public void TariffNotAvailable(Tariff[] tariff, DateTime dateTime) { var t = EPEXSPOT.FindTariff(tariff, dateTime); Assert.Null(t); }