From e930606a1ec45e74f0c5512e0b01181c263c53f6 Mon Sep 17 00:00:00 2001 From: Michael Krisper <michael.krisper@tugraz.at> Date: Wed, 13 Jul 2016 09:57:21 +0200 Subject: [PATCH] changed typo in Namespace "Adaper" --> "Adapter" --- VECTO/GUI/F_GBX.vb | 1 - .../DeclarationDataAdapter.cs | 3 +- .../EngineeringDataAdapter.cs | 4 +- .../DeclarationModeVectoRunDataFactory.cs | 2 +- .../Impl/EngineOnlyVectoRunDataFactory.cs | 2 +- .../EngineeringModeVectoRunDataFactory.cs | 4 +- .../Impl/CombustionEngine.cs | 12 +- .../Models/Declaration/DeclarationDataTest.cs | 157 +++++++++--------- .../Models/Declaration/ShiftPolygonTest.cs | 29 ++-- .../Models/SimulationComponent/VehicleTest.cs | 11 +- .../GearboxDataTest.cs | 1 - .../SimulationComponentData/ValidationTest.cs | 5 +- .../Utils/MockSimulationDataFactory.cs | 2 +- 13 files changed, 106 insertions(+), 127 deletions(-) diff --git a/VECTO/GUI/F_GBX.vb b/VECTO/GUI/F_GBX.vb index cb3ea2b2e6..9e391c2f87 100644 --- a/VECTO/GUI/F_GBX.vb +++ b/VECTO/GUI/F_GBX.vb @@ -15,7 +15,6 @@ Imports TUGraz.VectoCommon.InputData Imports TUGraz.VectoCommon.Utils Imports TUGraz.VectoCore.Configuration Imports TUGraz.VectoCore.InputData.Impl -Imports TUGraz.VectoCore.InputData.Reader.DataObjectAdaper Imports TUGraz.VectoCore.Models.Declaration Imports TUGraz.VectoCore.Models.SimulationComponent.Data Imports TUGraz.VectoCore.Models.SimulationComponent.Data.Engine diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs index f8a949140f..4e7e5c04f8 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs @@ -37,7 +37,6 @@ using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; -using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data; @@ -47,7 +46,7 @@ using TUGraz.VectoCore.OutputData; using TUGraz.VectoCore.Utils; using DriverData = TUGraz.VectoCore.Models.SimulationComponent.Data.DriverData; -namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdaper +namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter { public class DeclarationDataAdapter : AbstractSimulationDataAdapter { diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs index 16df52c79a..50e39a4ec9 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs @@ -36,16 +36,14 @@ using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; using TUGraz.VectoCore.OutputData; -using DriverData = TUGraz.VectoCore.Models.SimulationComponent.Data.DriverData; -namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdaper +namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter { public class EngineeringDataAdapter : AbstractSimulationDataAdapter { diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs index 4960dd4480..95f4c9c954 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs @@ -34,7 +34,7 @@ using System.Linq; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.InputData.Reader.DataObjectAdaper; +using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data; diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/EngineOnlyVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/EngineOnlyVectoRunDataFactory.cs index 1ef3792d93..9c89f79f64 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/EngineOnlyVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/EngineOnlyVectoRunDataFactory.cs @@ -32,7 +32,7 @@ using System.Collections.Generic; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; -using TUGraz.VectoCore.InputData.Reader.DataObjectAdaper; +using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data; diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs index 5471403d36..1431fa813b 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs @@ -34,9 +34,9 @@ using System.Linq; using System.Runtime.CompilerServices; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; -using TUGraz.VectoCore.InputData.Reader.DataObjectAdaper; +using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.Models.Simulation.Data; -using DriverData = TUGraz.VectoCore.Models.SimulationComponent.Data.DriverData; +using TUGraz.VectoCore.Models.SimulationComponent.Data; [assembly: InternalsVisibleTo("VectoCoreTest")] diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs index 1cd5b3cbfc..5cfd09c19c 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs @@ -30,6 +30,7 @@ */ using System; +using System.Collections.Generic; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; @@ -38,6 +39,7 @@ using TUGraz.VectoCore.Models.Connector.Ports; using TUGraz.VectoCore.Models.Connector.Ports.Impl; using TUGraz.VectoCore.Models.Simulation; using TUGraz.VectoCore.Models.Simulation.Data; +using TUGraz.VectoCore.Models.Simulation.Impl; using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.OutputData; using TUGraz.VectoCore.Utils; @@ -349,11 +351,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var fcWHTC = fcAux * ModelData.WHTCCorrectionFactor; var fcAAUX = fcWHTC; - var advancedAux = EngineAux as BusAuxiliariesAdapter; - if (advancedAux != null) { - advancedAux.DoWriteModalResults(container); - fcAAUX = advancedAux.AAuxFuelConsumption; - } + var advancedAux = EngineAux as BusAuxiliariesAdapter; + if (advancedAux != null) { + advancedAux.DoWriteModalResults(container); + fcAAUX = advancedAux.AAuxFuelConsumption; + } var fcFinal = fcAAUX; container[ModalResultField.FCMap] = fc; diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs index c2587bcfd1..f8b418d361 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs @@ -33,17 +33,15 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; using NUnit.Framework; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.InputData.Reader.DataObjectAdaper; +using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.Tests.Utils; using TUGraz.VectoCore.Utils; -using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert; using CrossWindCorrectionMode = TUGraz.VectoCommon.Models.CrossWindCorrectionMode; namespace TUGraz.VectoCore.Tests.Models.Declaration @@ -54,9 +52,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration public const double Tolerance = 0.0001; public readonly MissionType[] Missions = EnumHelper.GetValues<MissionType>().ToArray(); - [Test, - TestCase("285/70 R19.5", 7.9, 0.8943, "b"), - ] + [TestCase("285/70 R19.5", 7.9, 0.8943, "b")] public void WheelDataTest(string wheels, double intertia, double dynamicRadius, string sizeClass) { var tmp = DeclarationData.Wheels.Lookup(wheels); @@ -66,9 +62,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration Assert.AreEqual(sizeClass, tmp.SizeClass); } - [Test, - TestCase("15° DC Rims", 3.03, 3.05), - ] + [TestCase("15° DC Rims", 3.03, 3.05)] public void RimsDataTest(string rim, double fa, double fb) { var tmp = DeclarationData.Rims.Lookup(rim); @@ -77,30 +71,30 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration Assert.AreEqual(fb, tmp.F_b, Tolerance); } - [Test, - // fixed points - TestCase(400, 0), - TestCase(800, 0.47), - TestCase(1000, 0.58), - TestCase(1200, 0.53), - TestCase(1400, 0.46), - TestCase(1500, 0.43), - TestCase(1750, 0.22), - TestCase(1800, 0.2), - TestCase(2000, 0.11), - TestCase(2500, 0.11), - // interpolate - TestCase(600, 0.235), - TestCase(900, 0.525), - TestCase(1100, 0.555), - TestCase(1300, 0.495), - TestCase(1450, 0.445), - TestCase(1625, 0.325), - TestCase(1775, 0.21), - TestCase(1900, 0.155), - TestCase(2250, 0.11), - // extrapolate - TestCase(3000, 0.11), + [ + // fixed points + TestCase(400, 0), + TestCase(800, 0.47), + TestCase(1000, 0.58), + TestCase(1200, 0.53), + TestCase(1400, 0.46), + TestCase(1500, 0.43), + TestCase(1750, 0.22), + TestCase(1800, 0.2), + TestCase(2000, 0.11), + TestCase(2500, 0.11), + // interpolate + TestCase(600, 0.235), + TestCase(900, 0.525), + TestCase(1100, 0.555), + TestCase(1300, 0.495), + TestCase(1450, 0.445), + TestCase(1625, 0.325), + TestCase(1775, 0.21), + TestCase(1900, 0.155), + TestCase(2250, 0.11), + // extrapolate + TestCase(3000, 0.11), ] public void PT1Test(double rpm, double expectedPt1) { @@ -114,7 +108,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration AssertHelper.Exception<VectoException>(() => DeclarationData.PT1.Lookup(0.RPMtoRad())); } - [Test] + [TestCase] public void WHTCTest() { var whtc = DeclarationData.WHTCCorrection; @@ -136,7 +130,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration } } - [TestMethod] + [TestCase] public void WHTCLookupTestLongHaul() { var expected = 1.015501; @@ -150,7 +144,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration Assert.AreEqual(expected, lookup, 1e-8); } - [TestMethod] + [Test] public void WHTCLookupTestRegionalDelivery() { var expected = 1.02708700; @@ -242,32 +236,32 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration crossWindCorrectionCurve.EffectiveAirDragArea(kmph.KMPHtoMeterPerSecond())); } - [Test, - // fixed points - TestCase(150, 1.000, 1.000, 0.00), - TestCase(150, 1.100, 1.000, -40.34), - TestCase(150, 1.222, 1.000, -80.34), - TestCase(150, 1.375, 1.000, -136.11), - TestCase(150, 1.571, 1.000, -216.52), - TestCase(150, 1.833, 1.000, -335.19), - TestCase(150, 2.200, 1.000, -528.77), - TestCase(150, 2.750, 1.000, -883.40), - TestCase(150, 4.400, 1.000, -2462.17), - TestCase(150, 11.000, 1.000, -16540.98), - // interpolated - TestCase(150, 1.0025, 1.0, 0.0), - TestCase(150, 1.0525, 1.0, -20.17), - TestCase(150, 1.161, 1.0, -60.34), - TestCase(150, 1.2985, 1.0, -108.225), - TestCase(150, 1.473, 1.0, -176.315), - TestCase(150, 1.702, 1.0, -275.855), - TestCase(150, 2.0165, 1.0, -431.98), - TestCase(150, 2.475, 1.0, -706.085), - TestCase(150, 3.575, 1.0, -1672.785), - TestCase(150, 7.7, 1.0, -9501.575), - // extrapolated - TestCase(150, 0.5, 1.0, 0.0), - TestCase(150, 12.0, 1.0, -18674.133), // = (12-4.4)*(-16540.98- -2462.17)/(11-4.4)+ -2462.17 + [ + // fixed points + TestCase(150, 1.000, 1.000, 0.00), + TestCase(150, 1.100, 1.000, -40.34), + TestCase(150, 1.222, 1.000, -80.34), + TestCase(150, 1.375, 1.000, -136.11), + TestCase(150, 1.571, 1.000, -216.52), + TestCase(150, 1.833, 1.000, -335.19), + TestCase(150, 2.200, 1.000, -528.77), + TestCase(150, 2.750, 1.000, -883.40), + TestCase(150, 4.400, 1.000, -2462.17), + TestCase(150, 11.000, 1.000, -16540.98), + // interpolated + TestCase(150, 1.0025, 1.0, 0.0), + TestCase(150, 1.0525, 1.0, -20.17), + TestCase(150, 1.161, 1.0, -60.34), + TestCase(150, 1.2985, 1.0, -108.225), + TestCase(150, 1.473, 1.0, -176.315), + TestCase(150, 1.702, 1.0, -275.855), + TestCase(150, 2.0165, 1.0, -431.98), + TestCase(150, 2.475, 1.0, -706.085), + TestCase(150, 3.575, 1.0, -1672.785), + TestCase(150, 7.7, 1.0, -9501.575), + // extrapolated + TestCase(150, 0.5, 1.0, 0.0), + TestCase(150, 12.0, 1.0, -18674.133), // = (12-4.4)*(-16540.98- -2462.17)/(11-4.4)+ -2462.17 ] public void DefaultTcTest(double referenceRpm, double nu, double mu, double torque) { @@ -332,24 +326,26 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration } } - [Test, - TestCase("", - new[] { 618, 671, 516, 566, 1037, 0, 0, 0, 0, 0 }), - TestCase("Crankshaft mounted - Electronically controlled visco clutch (Default)", - new[] { 618, 671, 516, 566, 1037, 0, 0, 0, 0, 0 }), - TestCase("Crankshaft mounted - Bimetallic controlled visco clutch", new[] { 818, 871, 676, 766, 1277, 0, 0, 0, 0, 0 }), - TestCase("Crankshaft mounted - Discrete step clutch", new[] { 668, 721, 616, 616, 1157, 0, 0, 0, 0, 0 }), - TestCase("Crankshaft mounted - On/Off clutch", new[] { 718, 771, 666, 666, 1237, 0, 0, 0, 0, 0 }), - TestCase("Belt driven or driven via transm. - Electronically controlled visco clutch", - new[] { 889, 944, 733, 833, 1378, 0, 0, 0, 0, 0 }), - TestCase("Belt driven or driven via transm. - Bimetallic controlled visco clutch", - new[] { 1089, 1144, 893, 1033, 1618, 0, 0, 0, 0, 0 }), - TestCase("Belt driven or driven via transm. - Discrete step clutch", new[] { 939, 994, 883, 883, 1498, 0, 0, 0, 0, 0 } - ), - TestCase("Belt driven or driven via transm. - On/Off clutch", new[] { 989, 1044, 933, 933, 1578, 0, 0, 0, 0, 0 }), - TestCase("Hydraulic driven - Variable displacement pump", new[] { 738, 955, 632, 717, 1672, 0, 0, 0, 0, 0 }), - TestCase("Hydraulic driven - Constant displacement pump", new[] { 1000, 1200, 800, 900, 2100, 0, 0, 0, 0, 0 }), - TestCase("Hydraulic driven - Electronically controlled", new[] { 700, 800, 600, 600, 1400, 0, 0, 0, 0, 0 }), + [ + TestCase("", + new[] { 618, 671, 516, 566, 1037, 0, 0, 0, 0, 0 }), + TestCase("Crankshaft mounted - Electronically controlled visco clutch (Default)", + new[] { 618, 671, 516, 566, 1037, 0, 0, 0, 0, 0 }), + TestCase("Crankshaft mounted - Bimetallic controlled visco clutch", new[] { 818, 871, 676, 766, 1277, 0, 0, 0, 0, 0 } + ), + TestCase("Crankshaft mounted - Discrete step clutch", new[] { 668, 721, 616, 616, 1157, 0, 0, 0, 0, 0 }), + TestCase("Crankshaft mounted - On/Off clutch", new[] { 718, 771, 666, 666, 1237, 0, 0, 0, 0, 0 }), + TestCase("Belt driven or driven via transm. - Electronically controlled visco clutch", + new[] { 889, 944, 733, 833, 1378, 0, 0, 0, 0, 0 }), + TestCase("Belt driven or driven via transm. - Bimetallic controlled visco clutch", + new[] { 1089, 1144, 893, 1033, 1618, 0, 0, 0, 0, 0 }), + TestCase("Belt driven or driven via transm. - Discrete step clutch", + new[] { 939, 994, 883, 883, 1498, 0, 0, 0, 0, 0 } + ), + TestCase("Belt driven or driven via transm. - On/Off clutch", new[] { 989, 1044, 933, 933, 1578, 0, 0, 0, 0, 0 }), + TestCase("Hydraulic driven - Variable displacement pump", new[] { 738, 955, 632, 717, 1672, 0, 0, 0, 0, 0 }), + TestCase("Hydraulic driven - Constant displacement pump", new[] { 1000, 1200, 800, 900, 2100, 0, 0, 0, 0, 0 }), + TestCase("Hydraulic driven - Electronically controlled", new[] { 700, 800, 600, 600, 1400, 0, 0, 0, 0, 0 }), ] public void AuxFanTechTest(string technology, int[] expected) { @@ -636,7 +632,6 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration trailerType: TrailerType.None, minLoad: 0, refLoad: 4400, trailerGrossVehicleWeight: 0, deltaCdA: 0, maxLoad: 8400); } - /// <summary> /// Segment 5: fixed reference weight, trailer always used /// </summary> diff --git a/VectoCore/VectoCoreTest/Models/Declaration/ShiftPolygonTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/ShiftPolygonTest.cs index 99d82a1d7c..0337e89884 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/ShiftPolygonTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/ShiftPolygonTest.cs @@ -31,31 +31,27 @@ using System; using System.Collections.Generic; -using System.Diagnostics; -using System.Drawing; using System.IO; using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; using NUnit.Framework; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.FileIO.JSON; -using TUGraz.VectoCore.InputData.Reader.DataObjectAdaper; +using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; using TUGraz.VectoCore.Tests.Utils; using TUGraz.VectoCore.Utils; -using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert; using Point = TUGraz.VectoCore.Utils.Point; namespace TUGraz.VectoCore.Tests.Models.Declaration { - [TestClass] + [TestFixture] public class ShiftPolygonTest { - [TestMethod] + [TestCase] public void IntersectShiftLines1() { var upShift = new[] { @@ -86,7 +82,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration } } - [TestMethod] + [TestCase] public void IntersectShiftLines2() { var upShift = new[] { @@ -126,8 +122,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration } } - - [TestMethod] + [TestCase] public void IntersectShiftLines3() { var upShift = new[] { @@ -168,7 +163,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration } } - [TestMethod] + [TestCase] public void IntersectShiftLines4() { var upShift = new[] { @@ -209,7 +204,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration } } - [TestMethod] + [TestCase] public void ShiftPolygonFldMarginTest() { var engineFld = new[] { @@ -264,7 +259,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration } } - [TestMethod] + [TestCase] public void CorrectDownShiftByEngineFldTest() { var downshift = Edge.Create(new Point(10, 10), new Point(22, 20)); @@ -294,7 +289,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration Assert.AreEqual(20, corrected.P2.Y, 1e-3); } - [TestMethod] + [TestCase] public void CompueShiftPolygonDeclarationTest() { var engineFile = @"TestData\Components\40t_Long_Haul_Truck.veng"; @@ -371,8 +366,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration Assert.AreEqual(0, shiftPolygons.Last().Upshift.Count); } - - [TestMethod] + [TestCase] public void CompueShiftPolygonDeclarationTestConfidentialEngine() { //var engineFldFile = @"E:\QUAM\Downloads\EngineFLD\Map_375c_BB1390_modTUG_R49_375c_BB1386.vfld"; @@ -447,7 +441,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration double idlingSpeed) { if (!Directory.Exists(BasePath)) { - NUnit.Framework.Assert.Ignore("Confidential File not found. Test cannot run without file."); + Assert.Ignore("Confidential File not found. Test cannot run without file."); } var engineData = new CombustionEngineData() { @@ -483,7 +477,6 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration upshiftOrig, downshiftTransformed); } - public static void ComputShiftPolygonPoints(int gear, FullLoadCurve fullLoadCurve, IList<ITransmissionInputData> gears, CombustionEngineData engine, double axlegearRatio, Meter dynamicTyreRadius, out List<Point> upshiftOrig, out List<Point> downshiftTransformed, out List<Point> downshiftOrig) diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/VehicleTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/VehicleTest.cs index 983bbe03df..90ea43e51c 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/VehicleTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/VehicleTest.cs @@ -31,18 +31,15 @@ using System; using System.IO; -using Microsoft.VisualStudio.TestTools.UnitTesting; using NUnit.Framework; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.InputData.Reader.DataObjectAdaper; +using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.Impl; using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.Models.SimulationComponent.Impl; using TUGraz.VectoCore.Tests.Utils; -using TUGraz.VectoCore.Utils; -using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert; namespace TUGraz.VectoCore.Tests.Models.SimulationComponent { @@ -77,7 +74,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent var accell = -0.256231159.SI<MeterPerSquareSecond>(); var gradient = Math.Atan(0.00366547048).SI<Radian>(); - var retVal = requestPort.Request(absTime, dt, accell, gradient); + requestPort.Request(absTime, dt, accell, gradient); Assert.AreEqual(-2305.43268, mockPort.Force.Value(), 0.0001); Assert.AreEqual(16.954303841, mockPort.Velocity.Value(), 0.0001); @@ -136,12 +133,12 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent var absTime = 0.SI<Second>(); var dt = 0.5.SI<Second>(); - var retVal = vehicle.Request(absTime, dt, 0.SI<MeterPerSquareSecond>(), 0.SI<Radian>()); + vehicle.Request(absTime, dt, 0.SI<MeterPerSquareSecond>(), 0.SI<Radian>()); vehicle.CommitSimulationStep(writer); Assert.AreEqual(48201.2777, ((SI)writer[ModalResultField.P_air]).Value(), 0.1); - retVal = vehicle.Request(absTime, dt, 1.SI<MeterPerSquareSecond>(), 0.SI<Radian>()); + vehicle.Request(absTime, dt, 1.SI<MeterPerSquareSecond>(), 0.SI<Radian>()); vehicle.CommitSimulationStep(writer); Assert.AreEqual(49735.26379, ((SI)writer[ModalResultField.P_air]).Value(), 0.1); } diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs index d73ae6f18a..a94951be88 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs @@ -36,7 +36,6 @@ using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.Reader; -using TUGraz.VectoCore.InputData.Reader.DataObjectAdaper; using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponentData/ValidationTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponentData/ValidationTest.cs index f87c11281f..0e305dcc18 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponentData/ValidationTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponentData/ValidationTest.cs @@ -37,7 +37,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.Reader; -using TUGraz.VectoCore.InputData.Reader.DataObjectAdaper; +using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.Impl; using TUGraz.VectoCore.Models.SimulationComponent.Data; @@ -130,7 +130,6 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData Assert.IsTrue(engineData.IsValid()); } - [TestMethod] public void Validation_CombustionEngineData_Declaration() { @@ -250,13 +249,11 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData Assert.IsTrue(results.Any()); } - public class DeepDataObject { [Required, Range(41, 42)] protected int public_field = 5; } - public abstract class ParentDataObject { #region 4 parent instance fields diff --git a/VectoCore/VectoCoreTest/Utils/MockSimulationDataFactory.cs b/VectoCore/VectoCoreTest/Utils/MockSimulationDataFactory.cs index c4bc81c2fa..422b40d4e1 100644 --- a/VectoCore/VectoCoreTest/Utils/MockSimulationDataFactory.cs +++ b/VectoCore/VectoCoreTest/Utils/MockSimulationDataFactory.cs @@ -33,7 +33,7 @@ using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.FileIO.JSON; -using TUGraz.VectoCore.InputData.Reader.DataObjectAdaper; +using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.Models.SimulationComponent.Data; namespace TUGraz.VectoCore.Tests.Utils -- GitLab