From 0da7f1c5b98c9422a2f9e03b38ce77d85041eafc Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Wed, 3 Mar 2021 10:04:04 +0100
Subject: [PATCH] adapt testcases due to removing mappting auxiliaries

---
 .../CompletedBusFactorMethodTest.cs           |  2 +-
 .../Models/Simulation/AuxTests.cs             | 72 ++++---------------
 2 files changed, 14 insertions(+), 60 deletions(-)

diff --git a/VectoCore/VectoCoreTest/Integration/CompletedBus/CompletedBusFactorMethodTest.cs b/VectoCore/VectoCoreTest/Integration/CompletedBus/CompletedBusFactorMethodTest.cs
index e681d0cf44..a4053cc9d6 100644
--- a/VectoCore/VectoCoreTest/Integration/CompletedBus/CompletedBusFactorMethodTest.cs
+++ b/VectoCore/VectoCoreTest/Integration/CompletedBus/CompletedBusFactorMethodTest.cs
@@ -527,7 +527,7 @@ namespace TUGraz.VectoCore.Tests.Integration.CompletedBus
 			var specificElectric =
 				relatedRun.VectoRunDataSpezificBody.BusAuxiliaries.ElectricalUserInputsConfig;
 			
-			Assert.AreEqual(false, genericElectric.AlternatorType);
+			Assert.AreEqual(AlternatorType.Conventional, genericElectric.AlternatorType);
 			Assert.AreEqual(genericElectric.AlternatorType, specificElectric.AlternatorType);
 
 			Assert.AreEqual(null, genericElectric.MaxAlternatorPower);
diff --git a/VectoCore/VectoCoreTest/Models/Simulation/AuxTests.cs b/VectoCore/VectoCoreTest/Models/Simulation/AuxTests.cs
index 783f9a7fa4..78c8724654 100644
--- a/VectoCore/VectoCoreTest/Models/Simulation/AuxTests.cs
+++ b/VectoCore/VectoCoreTest/Models/Simulation/AuxTests.cs
@@ -205,7 +205,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation
 			}
 		}
 
-		[TestCase] // todo: update expected values as no mapping aux is used
+		[TestCase] 
 		public void AuxAllCombined()
 		{
 			var dataWriter = new MockModalDataContainer();
@@ -230,21 +230,22 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation
 			var speed = 578.22461991.RPMtoRad(); // = 2358 (nAuxiliary) * ratio
 			var torque = 500.SI<NewtonMeter>();
 			var t = 0.SI<Second>();
+			// MQ 2021-03-03: updated expected values - mapping auxiliary is no longer supported
 			var expected = new[] {
-				1200 + 6100 + 72.9166666666667,
+				1200 + 6100, // + 72.9166666666667,
 				// = 1000 * 0.07 (nAuxiliary=2358 and psupply=0) / 0.98 (efficiency_supply)
-				1200 + 3100 + 677.083333333333,
+				1200 + 3100, // + 677.083333333333,
 				// = 1000 * 0.65 (nAuxiliary=2358 and psupply=0.38) / 0.98 (efficiency_supply)
-				1200 + 2300 + 822.916666666667,
+				1200 + 2300, // + 822.916666666667,
 				// = 1000 * 0.79 (nAuxiliary=2358 and psupply=0.49) / 0.98 (efficiency_supply)
-				1200 + 4500 + 1031.25, // = ...
-				1200 + 6100 + 1166.66666666667,
-				1200 + 6100 + 1656.25,
-				1200 + 6100 + 2072.91666666667,
-				1200 + 6100 + 2510.41666666667,
-				1200 + 6100 + 2979.16666666667,
-				1200 + 6100 + 3322.91666666667,
-				1200 + 6100 + 3656.25
+				1200 + 4500, // + 1031.25, // = ...
+				1200 + 6100, // + 1166.66666666667,
+				1200 + 6100, // + 1656.25,
+				1200 + 6100, // + 2072.91666666667,
+				1200 + 6100, // + 2510.41666666667,
+				1200 + 6100, // + 2979.16666666667,
+				1200 + 6100, // + 3322.91666666667,
+				1200 + 6100, // + 3656.25
 			};
 
 			foreach (var e in expected) {
@@ -257,53 +258,6 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation
 			}
 		}
 
-		[TestCase] // TODO: remove?!
-		public void AuxMapping()
-		{
-			
-			var dataWriter = new MockModalDataContainer();
-			
-			var container = new VehicleContainer(ExecutionMode.Engineering, dataWriter);
-			var data = DrivingCycleDataReader.ReadFromFile(@"TestData\Cycles\Coach time based short.vdri",
-				CycleType.MeasuredSpeed, false);
-			// cycle ALT1 is set to values to equal the first few fixed points in the auxiliary file.
-			// ALT1.aux file: nAuxiliary speed 2358: 0, 0.38, 0.49, 0.64, ...
-			// ALT1 in cycle file: 0, 0.3724 (=0.38*0.96), 0.4802 (=0.49*0.96), 0.6272 (0.64*0.96), ...
-
-			var cycle = new MockDrivingCycle(container, data);
-			new MockTnOutPort();
-
-			var aux = new EngineAuxiliary(container);
-
-
-			var speed = 578.22461991.RPMtoRad(); // = 2358 (nAuxiliary) * ratio
-			var torque = 500.SI<NewtonMeter>();
-			var t = 0.SI<Second>();
-			var expected = new[] {
-				72.9166666666667,
-				// = 1000 * 0.07 (pmech from aux file at nAuxiliary=2358 and psupply=0) / 0.98 (efficiency_supply)
-				677.083333333333, // = 1000 * 0.65 (nAuxiliary=2358 and psupply=0.38) / 0.98
-				822.916666666667, // = 1000 * 0.79 (nAuxiliary=2358 and psupply=0.49) / 0.98
-				1031.25, // = ...
-				1166.66666666667,
-				1656.25,
-				2072.91666666667,
-				2510.41666666667,
-				2979.16666666667,
-				3322.91666666667,
-				3656.25
-			};
-
-			foreach (var e in expected) {
-				aux.Initialize(torque, speed);
-				var auxDemand = aux.TorqueDemand(t, t, torque, speed);
-
-				AssertHelper.AreRelativeEqual((e.SI<Watt>() / speed).Value(), auxDemand);
-
-				cycle.CommitSimulationStep(t, t, null);
-			}
-		}
-
 		
 		[Category("LongRunning")]
 		[TestCase]
-- 
GitLab