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

Skip to content
Snippets Groups Projects
Commit e91a148a authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

adding testcase showing error in reading and re-calculating hash of tires (if...

adding testcase showing error in reading and re-calculating hash of tires (if the order changes in the input)
parent d7a62bf3
No related branches found
No related tags found
No related merge requests found
source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -132,10 +132,10 @@ namespace VectoHashingTest ...@@ -132,10 +132,10 @@ namespace VectoHashingTest
Assert.AreEqual(expectedHash, existingHash); Assert.AreEqual(expectedHash, existingHash);
} }
[TestCase] [TestCase(@"Testdata\XML\ToHash\vecto_vehicle-sample_3axle1.xml"),
public void TestReadTyres1Index() TestCase(@"Testdata\XML\ToHash\vecto_vehicle-sample_3axle1_unsortedAxle.xml")]
public void TestReadTyres1Index(string file)
{ {
var file = @"Testdata\XML\ToHash\vecto_vehicle-sample_3axle1.xml";
var h = VectoHash.Load(file); var h = VectoHash.Load(file);
var expectedHash = new[] { var expectedHash = new[] {
"5074334bb2c090c5e258e9a664f5d19689a3f13d", "5074334bb2c090c5e258e9a664f5d19689a3f13d",
...@@ -146,7 +146,7 @@ namespace VectoHashingTest ...@@ -146,7 +146,7 @@ namespace VectoHashingTest
for (int i = 0; i < expectedHash.Length; i++) { for (int i = 0; i < expectedHash.Length; i++) {
var existingHash = h.ReadHash(VectoComponents.Tyre, i); var existingHash = h.ReadHash(VectoComponents.Tyre, i);
Assert.AreEqual(expectedHash[i], existingHash); Assert.AreEqual(expectedHash[i], existingHash, $"component index {i}");
} }
} }
...@@ -171,10 +171,10 @@ namespace VectoHashingTest ...@@ -171,10 +171,10 @@ namespace VectoHashingTest
"index exceeds number of components found! index: 3, #components: 3"); "index exceeds number of components found! index: 3, #components: 3");
} }
[TestCase] [TestCase(@"Testdata\XML\ToHash\vecto_vehicle-sample_3axle1.xml"),
public void TestComputeTyres1Index() TestCase(@"Testdata\XML\ToHash\vecto_vehicle-sample_3axle1_unsortedAxle.xml")]
public void TestComputeTyres1Index(string file)
{ {
var file = @"Testdata\XML\ToHash\vecto_vehicle-sample_3axle1.xml";
var h = VectoHash.Load(file); var h = VectoHash.Load(file);
var hash1 = h.ComputeHash(VectoComponents.Tyre, 1); var hash1 = h.ComputeHash(VectoComponents.Tyre, 1);
......
...@@ -196,6 +196,9 @@ ...@@ -196,6 +196,9 @@
<Content Include="Testdata\XML\ToHash\vecto_gearbox-input_nodata.xml"> <Content Include="Testdata\XML\ToHash\vecto_gearbox-input_nodata.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Testdata\XML\ToHash\vecto_vehicle-sample_3axle1_unsortedAxle.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\ToHash\vecto_vehicle-sample_3axle1.xml"> <Content Include="Testdata\XML\ToHash\vecto_vehicle-sample_3axle1.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
......
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