diff --git a/VectoCore/VectoCore/Models/Declaration/WHTCCorrection.cs b/VectoCore/VectoCore/Models/Declaration/WHTCCorrection.cs index 94a96663c4c72dba3a9fe8d550261d365995b2eb..fa7e2073d3691837b01b32f479ef72998efe8994 100644 --- a/VectoCore/VectoCore/Models/Declaration/WHTCCorrection.cs +++ b/VectoCore/VectoCore/Models/Declaration/WHTCCorrection.cs @@ -62,7 +62,7 @@ namespace TUGraz.VectoCore.Models.Declaration NormalizeTable(table); foreach (MissionType mission in Enum.GetValues(typeof(MissionType))) { var values = table.Columns[mission.ToString().ToLower()].Values<string>().ToDouble().ToArray(); - _data[mission] = new WHTCCorrectionEntry { Rural = values[0], Urban = values[1], Motorway = values[2] }; + _data[mission] = new WHTCCorrectionEntry { Urban = values[0], Rural = values[1], Motorway = values[2] }; } } diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs index 2c0fbef5af792148e47c75c7921b7966a0182351..ee53b31d86dd6816de127ffd93104ff5227b94aa 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs @@ -124,12 +124,42 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration var urban = r.NextDouble() * 2; var rural = r.NextDouble() * 2; var motorway = r.NextDouble() * 2; - var whtcValue = whtc.Lookup(Missions[i], urban, rural, motorway); + var whtcValue = whtc.Lookup(Missions[i], rural: rural, urban: urban, motorway: motorway); Assert.AreEqual(urban * factors.urban[i] + rural * factors.rural[i] + motorway * factors.motorway[i], whtcValue); } } + [TestMethod] + public void WHTCLookupTestLongHaul() + { + var expected = 1.015501; + + var rural = 1.0265; + var urban = 1.0948; + var motorway = 1.0057; + + var lookup = DeclarationData.WHTCCorrection.Lookup(MissionType.LongHaul, rural: rural, urban: urban, + motorway: motorway); + Assert.AreEqual(expected, lookup, 1e-8); + } + + + [TestMethod] + public void WHTCLookupTestRegionalDelivery() + { + var expected = 1.02708700; + + var rural = 1.0265; + var urban = 1.0948; + var motorway = 1.0057; + + var lookup = DeclarationData.WHTCCorrection.Lookup(MissionType.RegionalDelivery, rural: rural, urban: urban, + motorway: motorway); + Assert.AreEqual(expected, lookup, 1e-8); + } + + [TestMethod] public void AirDragTest() {