Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit a5f13e7d authored by Franz KOBER josef's avatar Franz KOBER josef
Browse files

added sort test case for TrailerAerodynamicDevice

parent f0c80f53
Branches
Tags
No related merge requests found
......@@ -53,7 +53,8 @@ namespace TUGraz.VectoCommon.Hashing
CapacitorSystem,
ElectricMachineSystem,
IEPC,
ADC
ADC,
CertifiedAeroReduction
}
public static class VectoComponentsExtensionMethods
......@@ -97,6 +98,8 @@ namespace TUGraz.VectoCommon.Hashing
return XMLNames.Component_IEPC;
case VectoComponents.ADC:
return XMLNames.Component_ADC;
case VectoComponents.CertifiedAeroReduction:
return XMLNames.Component_CertifiedAeroReduction;
default:
throw new ArgumentOutOfRangeException("VectoComponents", component, null);
}
......@@ -141,6 +144,8 @@ namespace TUGraz.VectoCommon.Hashing
return "IEPC-";
case VectoComponents.ADC:
return "ADC-";
case VectoComponents.CertifiedAeroReduction:
return "AERO-";
default:
throw new ArgumentOutOfRangeException("VectoComponents", component, null);
}
......
......@@ -1554,6 +1554,15 @@ namespace TUGraz.VectoCommon.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to CertifiedAeroReduction.
/// </summary>
public static string Component_CertifiedAeroReduction {
get {
return ResourceManager.GetString("Component_CertifiedAeroReduction", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Creator.
/// </summary>
......
......@@ -1878,4 +1878,7 @@
<data name="Component_IEPC" xml:space="preserve">
<value>IEPC</value>
</data>
<data name="Component_CertifiedAeroReduction" xml:space="preserve">
<value>CertifiedAeroReduction</value>
</data>
</root>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<tns:VectoInputDeclaration xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.7" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0"
xmlns:v2.1="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1" xmlns:v2.2="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.2"
xmlns:v2.7="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.7" xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationComponent:DEV:v2.7"
xmlns:di="http://www.w3.org/2000/09/xmldsig#" schemaVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationComponent v:\VectoCore\VectoCore\Resources\XSD/VectoDeclarationComponent.xsd">
<tns:CertifiedAeroReduction >
<Data xsi:type="CertifiedAeroDataDeclarationType" id="AERO-asdf">
<Manufacturer>Generic Manufacturer</Manufacturer>
<Model>Generic Tyre Model</Model>
<CertificationNumber>e12*0815/8051*2017/05T0000*00</CertificationNumber>
<Date>2017-02-15T11:00:00Z</Date>
<CertifiedAerodynamicReduction0>1.00</CertifiedAerodynamicReduction0>
<CertifiedAerodynamicReduction3>2.00</CertifiedAerodynamicReduction3>
<CertifiedAerodynamicReduction6>3.00</CertifiedAerodynamicReduction6>
<CertifiedAerodynamicReduction9>4.00</CertifiedAerodynamicReduction9>
<ApplicableVehicleGroups>
<ApplicableVehicleGroup>1123</ApplicableVehicleGroup>
<ApplicableVehicleGroup>2356</ApplicableVehicleGroup>
<ApplicableVehicleGroup>4356</ApplicableVehicleGroup>
</ApplicableVehicleGroups>
</Data>
<Signature>
<di:Reference URI="#AERO-asdf">
<di:Transforms>
<di:Transform Algorithm="urn:vecto:xml:2017:canonicalization"/>
<di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</di:Transforms>
<di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<di:DigestValue>3YVNlu+1souB/4IwePLPoBwhiJormfqMNRxQaZ75wvM=</di:DigestValue>
</di:Reference>
</Signature>
</tns:CertifiedAeroReduction>
</tns:VectoInputDeclaration>
<?xml version="1.0" encoding="UTF-8"?>
<tns:VectoInputDeclaration xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.7" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0"
xmlns:v2.1="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1" xmlns:v2.2="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.2"
xmlns:v2.7="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.7" xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationComponent:DEV:v2.7"
xmlns:di="http://www.w3.org/2000/09/xmldsig#" schemaVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationComponent v:\VectoCore\VectoCore\Resources\XSD/VectoDeclarationComponent.xsd">
<tns:CertifiedAeroReduction >
<Data xsi:type="CertifiedAeroDataDeclarationType" id="AERO-asdf">
<Manufacturer>Generic Manufacturer</Manufacturer>
<Model>Generic Tyre Model</Model>
<CertificationNumber>e12*0815/8051*2017/05T0000*00</CertificationNumber>
<Date>2017-02-15T11:00:00Z</Date>
<CertifiedAerodynamicReduction0>1.00</CertifiedAerodynamicReduction0>
<CertifiedAerodynamicReduction3>2.00</CertifiedAerodynamicReduction3>
<CertifiedAerodynamicReduction6>3.00</CertifiedAerodynamicReduction6>
<CertifiedAerodynamicReduction9>4.00</CertifiedAerodynamicReduction9>
<ApplicableVehicleGroups>
<ApplicableVehicleGroup>4356</ApplicableVehicleGroup>
<ApplicableVehicleGroup>1123</ApplicableVehicleGroup>
<ApplicableVehicleGroup>2356</ApplicableVehicleGroup>
</ApplicableVehicleGroups>
</Data>
<Signature>
<di:Reference URI="#AERO-asdf">
<di:Transforms>
<di:Transform Algorithm="urn:vecto:xml:2017:canonicalization"/>
<di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</di:Transforms>
<di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<di:DigestValue>3YVNlu+1souB/4IwePLPoBwhiJormfqMNRxQaZ75wvM=</di:DigestValue>
</di:Reference>
</Signature>
</tns:CertifiedAeroReduction>
</tns:VectoInputDeclaration>
......@@ -24,11 +24,11 @@ namespace VectoHashingTest
xmlInputReader = _kernel.Get<IXMLInputDataReader>();
}
[TestCase(@"Testdata\XML\Sort\Axlegear.xml")]
[TestCase(SortedComponentPath + "TrailerAerodynamicDevice.xml")]
public void TestHash(string filePath)
{
var loadedFile = VectoHash.Load(filePath);
var hash = loadedFile.ComputeHash(VectoComponents.Axlegear);
var hash = loadedFile.ComputeHash(VectoComponents.CertifiedAeroReduction);
}
[TestCase("ttvMnXYdQrEAu47QEO2AKyfzOdPSlcdsR/MrmH/mX+k=", SortedComponentPath + "Engine.xml"),
......@@ -134,5 +134,14 @@ namespace VectoHashingTest
var loadedFile = VectoHash.Load(filePath);
Assert.AreEqual(expectedHash, loadedFile.ComputeHash(VectoComponents.IEPC));
}
[TestCase("3YVNlu+1souB/4IwePLPoBwhiJormfqMNRxQaZ75wvM=", SortedComponentPath + "TrailerAerodynamicDevice.xml"),
TestCase("3YVNlu+1souB/4IwePLPoBwhiJormfqMNRxQaZ75wvM=", UnsortedComponentPath + "TrailerAerodynamicDevice.xml")]
public void TestTrailerAerodynamicDeviceSort(string expectedHash, string filePath)
{
var loadedFile = VectoHash.Load(filePath);
Assert.AreEqual(expectedHash, loadedFile.ComputeHash(VectoComponents.CertifiedAeroReduction));
}
}
}
......@@ -114,6 +114,9 @@
<Content Include="Testdata\XML\Sort\Component\Sorted\IEPC_StdValues.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Component\Sorted\TrailerAerodynamicDevice.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Component\Unsorted\ADC.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
......@@ -183,6 +186,9 @@
<Content Include="Testdata\XML\Sort\Component\Unsorted\TorqueConverter.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Component\Unsorted\TrailerAerodynamicDevice.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\ToHash\multiple_components.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment