From 6adc1b53e30b757700c6bad3646312b82c6c5c98 Mon Sep 17 00:00:00 2001 From: pierrepetersmeier Date: Mon, 29 Jul 2024 13:47:13 +0200 Subject: [PATCH] use should approximate instead of should be and DefaultTestData. --- .../participant/load/FixedLoadModelSpec.scala | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/test/scala/edu/ie3/simona/model/participant/load/FixedLoadModelSpec.scala b/src/test/scala/edu/ie3/simona/model/participant/load/FixedLoadModelSpec.scala index e8b4a321f6..98fd066841 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/load/FixedLoadModelSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/load/FixedLoadModelSpec.scala @@ -13,9 +13,8 @@ import edu.ie3.simona.model.participant.load.LoadReference.{ ActivePower, EnergyConsumption, } -import edu.ie3.simona.test.common.UnitSpec import edu.ie3.simona.test.common.input.LoadInputTestData -import edu.ie3.util.TimeUtil +import edu.ie3.simona.test.common.{DefaultTestData, UnitSpec} import edu.ie3.util.quantities.PowerSystemUnits import org.scalatest.prop.TableDrivenPropertyChecks import squants.Power @@ -24,20 +23,17 @@ import squants.energy.{KilowattHours, Kilowatts, Watts} class FixedLoadModelSpec extends UnitSpec with LoadInputTestData + with DefaultTestData with TableDrivenPropertyChecks { private implicit val tolerance: Power = Watts(1d) "A fixed load model" should { - val simulationStartDate = - TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z") - val simulationEndDate = - TimeUtil.withDefaults.toZonedDateTime("2019-12-31T23:59:00Z") - val foreSeenOperationInterval = + val defaultOperationInterval = SystemComponent.determineOperationInterval( - simulationStartDate, - simulationEndDate, + defaultSimulationStart, + defaultSimulationEnd, loadInput.getOperationTime, ) @@ -52,7 +48,7 @@ class FixedLoadModelSpec val actual = new FixedLoadModel( loadInput.getUuid, loadInput.getId, - foreSeenOperationInterval, + defaultOperationInterval, QControl.apply(loadInput.getqCharacteristics), Kilowatts( loadInput.getsRated @@ -86,7 +82,7 @@ class FixedLoadModelSpec val dut = new FixedLoadModel( loadInput.getUuid, loadInput.getId, - foreSeenOperationInterval, + defaultOperationInterval, QControl.apply(loadInput.getqCharacteristics), Kilowatts( loadInput.getsRated @@ -131,7 +127,7 @@ class FixedLoadModelSpec val dut = new FixedLoadModel( loadInput.getUuid, loadInput.getId, - foreSeenOperationInterval, + defaultOperationInterval, QControl.apply(loadInput.getqCharacteristics), scaledSRated, loadInput.getCosPhiRated,