예제 #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);
    }
예제 #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));
     });
 }
예제 #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);
    }
예제 #4
0
    public void TariffNotAvailable(Tariff[] tariff, DateTime dateTime)
    {
        var t = EPEXSPOT.FindTariff(tariff, dateTime);

        Assert.Null(t);
    }