From 49d61f07cebf068246dffbd3de5dd501a9150c7f Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Mon, 24 Feb 2020 09:27:22 +0100
Subject: [PATCH]  fix testcases (null reference exceptions)

---
 .../VectoCore/OutputData/SummaryDataContainer.cs     |  2 +-
 VectoCore/VectoCoreTest/FileIO/JsonReadTest.cs       | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs b/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs
index d968799e59..f1d2061bc5 100644
--- a/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs
+++ b/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs
@@ -707,7 +707,7 @@ namespace TUGraz.VectoCore.OutputData
 			row[Fields.VIN_NUMBER] = data.VIN;
 			row[Fields.VEHICLE_MODEL] = data.ModelName;
 
-			row[Fields.HDV_CO2_VEHICLE_CLASS] = runData.Mission.BusParameter?.BusGroup.GetClassNumber() ?? data.VehicleClass.GetClassNumber();
+			row[Fields.HDV_CO2_VEHICLE_CLASS] = runData.Mission?.BusParameter?.BusGroup.GetClassNumber() ?? data.VehicleClass.GetClassNumber();
 			row[Fields.CURB_MASS] = (ConvertedSI)data.CurbMass;
 
 			// - (data.BodyAndTrailerWeight ?? 0.SI<Kilogram>());
diff --git a/VectoCore/VectoCoreTest/FileIO/JsonReadTest.cs b/VectoCore/VectoCoreTest/FileIO/JsonReadTest.cs
index b9975eb8c1..4f2fe51e1d 100644
--- a/VectoCore/VectoCoreTest/FileIO/JsonReadTest.cs
+++ b/VectoCore/VectoCoreTest/FileIO/JsonReadTest.cs
@@ -184,7 +184,7 @@ namespace TUGraz.VectoCore.Tests.FileIO
 						GearshiftInputData = (IGearshiftEngineeringInputData)inputProvider
 					},
 					JobInputData = new MockJobInputData() {
-						Vehicle = new MockEngineeringVehicleInputData() {
+						IEngineeringJobInputData_Vehicle = new MockEngineeringVehicleInputData() {
 							GearboxInputData = inputProvider,
 							TorqueConverterInputData = (ITorqueConverterEngineeringInputData)inputProvider,
 						}
@@ -225,7 +225,7 @@ namespace TUGraz.VectoCore.Tests.FileIO
 						GearshiftInputData = (IGearshiftEngineeringInputData)inputProvider
 					},
 					JobInputData = new MockJobInputData() {
-						Vehicle = new MockEngineeringVehicleInputData() {
+						IEngineeringJobInputData_Vehicle = new MockEngineeringVehicleInputData() {
 							GearboxInputData = inputProvider,
 							TorqueConverterInputData = (ITorqueConverterEngineeringInputData)inputProvider,
 						}
@@ -273,7 +273,7 @@ namespace TUGraz.VectoCore.Tests.FileIO
 						GearshiftInputData = (IGearshiftEngineeringInputData)inputProvider
 					},
 					JobInputData = new MockJobInputData() {
-						Vehicle = new MockEngineeringVehicleInputData() {
+						IEngineeringJobInputData_Vehicle = new MockEngineeringVehicleInputData() {
 							GearboxInputData = inputProvider,
 							TorqueConverterInputData = (ITorqueConverterEngineeringInputData)inputProvider,
 						}
@@ -320,7 +320,7 @@ namespace TUGraz.VectoCore.Tests.FileIO
 						GearshiftInputData = (IGearshiftEngineeringInputData)inputProvider
 					},
 					JobInputData = new MockJobInputData() {
-						Vehicle = new MockEngineeringVehicleInputData() {
+						IEngineeringJobInputData_Vehicle = new MockEngineeringVehicleInputData() {
 							GearboxInputData = inputProvider,
 							TorqueConverterInputData = (ITorqueConverterEngineeringInputData)inputProvider,
 						}
@@ -368,7 +368,7 @@ namespace TUGraz.VectoCore.Tests.FileIO
 						GearshiftInputData = (IGearshiftEngineeringInputData)inputProvider
 					},
 					JobInputData = new MockJobInputData() {
-						Vehicle = new MockEngineeringVehicleInputData() {
+						IEngineeringJobInputData_Vehicle = new MockEngineeringVehicleInputData() {
 							GearboxInputData = inputProvider,
 							TorqueConverterInputData = (ITorqueConverterEngineeringInputData)inputProvider,
 						}
@@ -416,7 +416,7 @@ namespace TUGraz.VectoCore.Tests.FileIO
 						GearshiftInputData = (IGearshiftEngineeringInputData)inputProvider
 					},
 					JobInputData = new MockJobInputData() {
-						Vehicle = new MockEngineeringVehicleInputData() {
+						IEngineeringJobInputData_Vehicle = new MockEngineeringVehicleInputData() {
 							GearboxInputData = inputProvider,
 							TorqueConverterInputData = (ITorqueConverterEngineeringInputData)inputProvider,
 						}
-- 
GitLab