Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
 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));
     });
 }
Ejemplo n.º 3
0
    public void HandlesEmpty()
    {
        var t = EPEXSPOT.FindTariff(Array.Empty <Tariff>(), new DateTime(2021, 12, 29, 12, 00, 00, DateTimeKind.Utc));

        Assert.Null(t);
    }
Ejemplo n.º 4
0
    public void TariffNotAvailable(Tariff[] tariff, DateTime dateTime)
    {
        var t = EPEXSPOT.FindTariff(tariff, dateTime);

        Assert.Null(t);
    }