Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit d23d6706 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

Merge pull request #483 in VECTO/vecto-sim from...

Merge pull request #483 in VECTO/vecto-sim from ~EMQUARIMA/vecto-sim:bugfix/VECTO-546-gearboxcertificationoptiontype to develop

* commit '694e496e':
  adding missing certification options
  reproduce bug in testcase
parents d57b69e0 694e496e
No related branches found
No related tags found
No related merge requests found
......@@ -29,31 +29,40 @@
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/
using System;
namespace TUGraz.VectoCommon.Models
{
public enum CertificationMethod
{
StandardValues,
Measured,
NotCertified
}
public static class CertificationMethodHelper
{
public static string ToXMLFormat(this CertificationMethod method)
{
switch (method) {
case CertificationMethod.StandardValues:
return "Standard values";
case CertificationMethod.Measured:
return "Measured";
case CertificationMethod.NotCertified:
return "NOT CERTIFIED";
default:
throw new ArgumentOutOfRangeException("CertificationMethod", method, null);
}
}
}
using System;
namespace TUGraz.VectoCommon.Models
{
public enum CertificationMethod
{
StandardValues,
Measured,
Option1,
Option2,
Option3,
NotCertified
}
public static class CertificationMethodHelper
{
public static string ToXMLFormat(this CertificationMethod method)
{
switch (method) {
case CertificationMethod.StandardValues:
return "Standard values";
case CertificationMethod.Measured:
return "Measured";
case CertificationMethod.Option1:
return "Option 1";
case CertificationMethod.Option2:
return "Option 2";
case CertificationMethod.Option3:
return "Option 3";
case CertificationMethod.NotCertified:
return "NOT CERTIFIED";
default:
throw new ArgumentOutOfRangeException("CertificationMethod", method, null);
}
}
}
}
\ No newline at end of file
source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -60,6 +60,9 @@ namespace TUGraz.VectoCore.Tests.XML
const string SampleVehicleDecl = "TestData/XML/XMLReaderDeclaration/vecto_vehicle-sample.xml";
const string SampleVehicleFullDecl = "TestData/XML/XMLReaderDeclaration/vecto_vehicle-sample_FULL.xml";
const string SampleVehicleFullDeclCertificationOptions =
"TestData/XML/XMLReaderDeclaration/vecto_vehicle-sample_certificationOptions.xml";
[TestMethod]
public void TestXMLInputEng()
{
......@@ -802,5 +805,18 @@ namespace TUGraz.VectoCore.Tests.XML
Assert.AreEqual("only the drive shaft of the PTO - multi-disc clutch", ptoDataProvider.PTOTransmissionType);
Assert.AreEqual(1000, lookup.PowerDemand.Value());
}
[TestMethod]
public void TestCertificationMethodInput()
{
var reader = XmlReader.Create(SampleVehicleFullDeclCertificationOptions);
var inputDataProvider = new XMLDeclarationInputDataProvider(reader, true);
Assert.AreEqual(CertificationMethod.Option2, inputDataProvider.GearboxInputData.CertificationMethod);
Assert.AreEqual(CertificationMethod.Measured, inputDataProvider.AxleGearInputData.CertificationMethod);
Assert.AreEqual(CertificationMethod.Measured, inputDataProvider.RetarderInputData.CertificationMethod);
Assert.AreEqual(CertificationMethod.Measured, inputDataProvider.AirdragInputData.CertificationMethod);
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment