This commit is contained in:
@@ -10,14 +10,14 @@ use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class BatterieReglerTest extends TestCase
|
||||
{
|
||||
public function testLeistungsrasterBehaeltGrobeUndFeineSchritte(): void
|
||||
public function testLeistungsbereichBleibtInnerhalbDynamischerGrenzen(): void
|
||||
{
|
||||
self::assertSame(
|
||||
[
|
||||
-1000, -750, -500, -250, -200, -150, -100, -50,
|
||||
0, 50, 100, 150, 200, 250, 500, 750, 1000,
|
||||
],
|
||||
BatterieRegler::leistungsraster(1000.0, 1000.0)
|
||||
[['Von_W' => -999, 'Bis_W' => 1000]],
|
||||
BatterieRegler::leistungsangebot(
|
||||
true, true, false, 50.0, 20.0, 10.0, false,
|
||||
0.0, 0.0, 1000.9, 999.9
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -28,12 +28,10 @@ final class BatterieReglerTest extends TestCase
|
||||
self::assertFalse(BatterieRegler::hystereseAktiv(22.1, 20.0, 2.0, true));
|
||||
}
|
||||
|
||||
public function testPvAngebotEntsprichtDemBisherigenSocVerhalten(): void
|
||||
public function testPvAngebotVerwendetStufenloseBereicheMitBisherigerSocLogik(): void
|
||||
{
|
||||
$voll = BatterieRegler::leistungsraster(1000.0, 1000.0);
|
||||
|
||||
self::assertSame(
|
||||
$voll,
|
||||
[['Von_W' => -1000, 'Bis_W' => 1000]],
|
||||
BatterieRegler::leistungsangebot(
|
||||
true, true, false, 50.0, 20.0, 10.0, false,
|
||||
0.0, 0.0, 1000.0, 1000.0
|
||||
@@ -47,7 +45,7 @@ final class BatterieReglerTest extends TestCase
|
||||
)
|
||||
);
|
||||
self::assertSame(
|
||||
[-1000, -750, -500, -250, -200, -150, -100, -50, 0],
|
||||
[['Von_W' => -1000, 'Bis_W' => 0]],
|
||||
BatterieRegler::leistungsangebot(
|
||||
true, true, false, 100.0, 20.0, 10.0, false,
|
||||
0.0, 0.0, 1000.0, 1000.0
|
||||
@@ -66,6 +64,24 @@ final class BatterieReglerTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function testPeakEinschraenkungenWerdenAlsBereicheGemeldet(): void
|
||||
{
|
||||
self::assertSame(
|
||||
[['Von_W' => -1000, 'Bis_W' => 0]],
|
||||
BatterieRegler::leistungsangebot(
|
||||
true, true, true, 21.0, 20.0, 10.0, true,
|
||||
0.0, 0.0, 1000.0, 1000.0
|
||||
)
|
||||
);
|
||||
self::assertSame(
|
||||
[['Von_W' => 0, 'Bis_W' => 1000]],
|
||||
BatterieRegler::leistungsangebot(
|
||||
true, true, true, 10.0, 20.0, 10.0, true,
|
||||
0.0, 0.0, 1000.0, 1000.0
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function testWechselrichtersteuerungBietetNurNull(): void
|
||||
{
|
||||
self::assertSame(
|
||||
@@ -186,6 +202,9 @@ final class BatterieReglerTest extends TestCase
|
||||
{
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
|
||||
BatterieRegler::leistungsraster(-1.0, 1000.0);
|
||||
BatterieRegler::leistungsangebot(
|
||||
true, true, false, 50.0, 20.0, 10.0, false,
|
||||
0.0, 0.0, -1.0, 1000.0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user