Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/ClosingStructuresImporter.cs =================================================================== diff -u -r0e8c9f3912451d121375b590426837a3e6683dc5 -rce36fdd8e9af2866739cc67c82ea820f51533777 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/ClosingStructuresImporter.cs (.../ClosingStructuresImporter.cs) (revision 0e8c9f3912451d121375b590426837a3e6683dc5) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/ClosingStructuresImporter.cs (.../ClosingStructuresImporter.cs) (revision ce36fdd8e9af2866739cc67c82ea820f51533777) @@ -73,7 +73,9 @@ ThrowValidationErrorForStructure(structureLocation.Name, structureLocation.Id, parameterRowsValidationResult.ErrorMessages); } - ClosingStructure closingStructure = CreateClosingStructure(structureLocation, structureParameterRows); + IEnumerable closingStructureParameters = + StructuresParameterRowsValidator.GetRelevantClosingStructuresParameters(structureParameterRows); + ClosingStructure closingStructure = CreateClosingStructure(structureLocation, closingStructureParameters); closingStructures.Add(closingStructure); } return closingStructures; Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/ClosingStructuresImporterTest.cs =================================================================== diff -u -rf28e5c177128224ea84257a3f29677f38b51f33f -rce36fdd8e9af2866739cc67c82ea820f51533777 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/ClosingStructuresImporterTest.cs (.../ClosingStructuresImporterTest.cs) (revision f28e5c177128224ea84257a3f29677f38b51f33f) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/ClosingStructuresImporterTest.cs (.../ClosingStructuresImporterTest.cs) (revision ce36fdd8e9af2866739cc67c82ea820f51533777) @@ -316,6 +316,48 @@ } [Test] + public void Import_AllParameterIdsDefinedAndDuplicateUnknownParameterId_TrueAndImportTargetUpdated() + { + // Setup + var importTarget = new StructureCollection(); + string filePath = Path.Combine(commonIoTestDataPath, "StructuresWithDuplicateIrrelevantParameterInCsv", + "Kunstwerken.shp"); + + var messageProvider = mocks.Stub(); + var strategy = mocks.StrictMock>(); + strategy.Expect(s => s.UpdateStructuresWithImportedData(null, null, null)).IgnoreArguments() + .WhenCalled(invocation => + { + Assert.AreSame(invocation.Arguments[0], importTarget); + Assert.AreSame(invocation.Arguments[2], filePath); + + var readStructures = (IEnumerable) invocation.Arguments[1]; + Assert.AreEqual(1, readStructures.Count()); + }) + .Return(Enumerable.Empty()); + mocks.ReplayAll(); + + var referencePoints = new List + { + new Point2D(154493.618, 568995.991), + new Point2D(156844.169, 574771.498), + new Point2D(157910.502, 579115.458), + new Point2D(163625.153, 585151.261) + }; + var referenceLine = new ReferenceLine(); + referenceLine.SetGeometry(referencePoints); + + var importer = new ClosingStructuresImporter(importTarget, referenceLine, filePath, + messageProvider, strategy); + + // Call + bool importResult = importer.Import(); + + // Assert + Assert.IsTrue(importResult); + } + + [Test] public void DoPostImport_UpdateStrategyReturningObservables_AllObservablesNotified() { var messageProvider = mocks.Stub(); Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/StructuresWithDuplicateIrrelevantParameterInCsv/Kunstwerken.csv =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/StructuresWithDuplicateIrrelevantParameterInCsv/Kunstwerken.csv (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/StructuresWithDuplicateIrrelevantParameterInCsv/Kunstwerken.csv (revision ce36fdd8e9af2866739cc67c82ea820f51533777) @@ -0,0 +1,52 @@ +Namespace;Identificatie;Versie;Kunstwerken.identificatie;Parameter.code;Parameter.omschrijving;Grootheid.code;Grootheid.omschrijving;Eenheid.code;Eenheid.omschrijving;Hoedanigheid.code;Hoedanigheid.omschrijving;Waardebepalingsmethode.code;Waardebepalingsmethode.codespace;Waardebewerkingsmethode.code;Waardebewerkingsmethode.codespace;AlfanumeriekeWaarde;NumeriekeWaarde;Standaardafwijking.variatie;Boolean;Kwaliteitsoordeel.code +12;KWK_1;1;KW_Onbekend;15;15;15;15;15;15;;;15;;;;;1;0;0; +12;KWK_1;1;KW_Onbekend;15;15;15;15;15;15;;;15;;;;;1;0;0; +12;KWK_1;1;KW_HOOGTE1;KUNSTW;Kunstwerk;ORIENTATIE;Ori�ntatie;grad;graden;;;Schematiseringshandleiding;;;;;45;0;0; +12;KWK_1;1;KW_HOOGTE2;KRUIN;Kruin;NIVEAU;Niveau;m;meter;;;Schematiseringshandleiding;;;;;5.9;0.01;1; +12;KWK_1;1;KW_HOOGTE3;STROM;Stroming;BREEDTE;Breedte;m;meter;;;Schematiseringshandleiding;;;;;18.5;0.05;0; +12;KWK_1;1;KW_HOOGTE4;OVS;Overslag;DEBIET;Debiet;m3/s/m;kubieke meter per seconden per meter;;;Schematiseringshandleiding;;;;;0.1;0.15;0; +12;KWK_1;1;KW_HOOGTE5;KRUIN;Kruin;BREEDTE;Breedte;m;meter;;;Schematiseringshandleiding;;;;;4;0.05;1; +12;KWK_1;1;KW_HOOGTE6;KUNSTW;Kunstwerk;FAALKANS;Faalkans;;;;;Schematiseringshandleiding;;;;;1;0;0; +12;KWK_1;1;KW_HOOGTE7;KOMBERG;Komberging;OPPERVLAKTE;Oppervlakte;m2;vierkante meter;;;Schematiseringshandleiding;;;;;500000;0.1;0; +12;KWK_1;1;KW_HOOGTE8;PEIL;Peil;VERHOGING;Verhoging;m;meter;;;Schematiseringshandleiding;;;;;6.5;0.1;0; +12;KWK_1;1;KW_BETSLUIT1;1;1;1;1;1;1;;;1;;;;;1;0.01;0; +12;KWK_1;1;KW_BETSLUIT2;2;2;2;2;2;2;;;2;;;;;1;0.01;0; +12;KWK_1;1;KW_BETSLUIT3;3;3;3;3;3;3;;;3;;;;;1;0;0; +12;KWK_1;1;KW_BETSLUIT4;4;4;4;4;4;4;;;4;;;;;1;0.01;0; +12;KWK_1;1;KW_BETSLUIT5;5;5;5;5;5;5;;;5;;;;;1;0.01;0; +12;KWK_1;1;KW_BETSLUIT6;6;6;6;6;6;6;;;6;;;;;1;0.01;0; +12;KWK_1;1;KW_BETSLUIT7;7;7;7;7;7;7;;;7;;;;;1;0.01;0; +12;KWK_1;1;KW_BETSLUIT8;8;8;8;8;8;8;;;8;;;;;1;0.01;0; +12;KWK_1;1;KW_BETSLUIT9;9;9;9;9;9;9;;;9;;;;;1;0.01;0; +12;KWK_1;1;KW_BETSLUIT10;10;10;10;10;10;10;;;10;;;;;1;0;0; +12;KWK_1;1;KW_BETSLUIT11;11;11;11;11;11;11;;;11;;;;;1;0;0; +12;KWK_1;1;KW_BETSLUIT12;12;12;12;12;12;12;;;12;;;;;1;0;0; +12;KWK_1;1;KW_BETSLUIT13;13;13;13;13;13;13;;;13;;;;;1;0;0; +12;KWK_1;1;KW_BETSLUIT14;14;14;14;14;14;14;;;14;;;;;1;0;0; +12;KWK_1;1;KW_BETSLUIT15;15;15;15;15;15;15;;;15;;;;LageDrempel;1;0;0; +12;KWK_1;1;KW_STERSTAB1;1;1;1;1;1;1;;;1;;;;;1;0.01;0; +12;KWK_1;1;KW_STERSTAB2;2;2;2;2;2;2;;;2;;;;;1;0.01;0; +12;KWK_1;1;KW_STERSTAB3;3;3;3;3;3;3;;;3;;;;;1;0;0; +12;KWK_1;1;KW_STERSTAB4;4;4;4;4;4;4;;;4;;;;;1;0.01;0; +12;KWK_1;1;KW_STERSTAB5;5;5;5;5;5;5;;;5;;;;;1;0.01;0; +12;KWK_1;1;KW_STERSTAB6;6;6;6;6;6;6;;;6;;;;;1;0.01;0; +12;KWK_1;1;KW_STERSTAB7;7;7;7;7;7;7;;;7;;;;;1;0.01;0; +12;KWK_1;1;KW_STERSTAB8;8;8;8;8;8;8;;;8;;;;;1;0.01;0; +12;KWK_1;1;KW_STERSTAB9;9;9;9;9;9;9;;;9;;;;;1;0.01;0; +12;KWK_1;1;KW_STERSTAB10;10;10;10;10;10;10;;;10;;;;;1;0;0; +12;KWK_1;1;KW_STERSTAB11;11;11;11;11;11;11;;;11;;;;;1;0;0; +12;KWK_1;1;KW_STERSTAB12;12;12;12;12;12;12;;;12;;;;;1;0;0; +12;KWK_1;1;KW_STERSTAB13;13;13;13;13;13;13;;;13;;;;;1;0;0; +12;KWK_1;1;KW_STERSTAB14;14;14;14;14;14;14;;;14;;;;;1;0;0; +12;KWK_1;1;KW_STERSTAB15;14;14;14;14;14;14;;;14;;;;;1;0;0; +12;KWK_1;1;KW_STERSTAB16;14;14;14;14;14;14;;;14;;;;;1;0;0; +12;KWK_1;1;KW_STERSTAB17;14;14;14;14;14;14;;;14;;;;;1;0;0; +12;KWK_1;1;KW_STERSTAB18;14;14;14;14;14;14;;;14;;;;;1;0;0; +12;KWK_1;1;KW_STERSTAB19;14;14;14;14;14;14;;;14;;;;;1;0;0; +12;KWK_1;1;KW_STERSTAB20;14;14;14;14;14;14;;;14;;;;;1;0;0; +12;KWK_1;1;KW_STERSTAB21;14;14;14;14;14;14;;;14;;;;;1;0;0; +12;KWK_1;1;KW_STERSTAB22;14;14;14;14;14;14;;;14;;;;;1;0;0; +12;KWK_1;1;KW_STERSTAB23;14;14;14;14;14;14;;;14;;;;;1;0;0; +12;KWK_1;1;KW_STERSTAB24;14;14;14;14;14;14;;;14;;;;;1;0;0; +12;KWK_1;1;KW_STERSTAB25;14;14;14;14;14;14;;;14;;;;;1;0;0; +12;KWK_1;1;KW_STERSTAB26;15;15;15;15;15;15;;;15;;;;LageDrempel;1;0;0; \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/StructuresWithDuplicateIrrelevantParameterInCsv/Kunstwerken.dbf =================================================================== diff -u Binary files differ Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/StructuresWithDuplicateIrrelevantParameterInCsv/Kunstwerken.shp =================================================================== diff -u Binary files differ Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/StructuresWithDuplicateIrrelevantParameterInCsv/Kunstwerken.shx =================================================================== diff -u Binary files differ Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/HeightStructuresImporter.cs =================================================================== diff -u -r0e8c9f3912451d121375b590426837a3e6683dc5 -rce36fdd8e9af2866739cc67c82ea820f51533777 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/HeightStructuresImporter.cs (.../HeightStructuresImporter.cs) (revision 0e8c9f3912451d121375b590426837a3e6683dc5) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/HeightStructuresImporter.cs (.../HeightStructuresImporter.cs) (revision ce36fdd8e9af2866739cc67c82ea820f51533777) @@ -71,7 +71,9 @@ ThrowValidationErrorForStructure(structureLocation.Name, structureLocation.Id, parameterRowsValidationResult.ErrorMessages); } - HeightStructure heightStructure = CreateHeightStructure(structureLocation, structureParameterRows); + IEnumerable heightStructureParameterRows = + StructuresParameterRowsValidator.GetRelevantHeightStructuresParameters(structureParameterRows); + HeightStructure heightStructure = CreateHeightStructure(structureLocation, heightStructureParameterRows); heightStructures.Add(heightStructure); } return heightStructures; Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/HeightStructuresImporterTest.cs =================================================================== diff -u -rf28e5c177128224ea84257a3f29677f38b51f33f -rce36fdd8e9af2866739cc67c82ea820f51533777 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/HeightStructuresImporterTest.cs (.../HeightStructuresImporterTest.cs) (revision f28e5c177128224ea84257a3f29677f38b51f33f) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/HeightStructuresImporterTest.cs (.../HeightStructuresImporterTest.cs) (revision ce36fdd8e9af2866739cc67c82ea820f51533777) @@ -314,6 +314,48 @@ } [Test] + public void Import_AllParameterIdsDefinedAndDuplicateUnknownParameterId_TrueAndImportTargetUpdated() + { + // Setup + var importTarget = new StructureCollection(); + string filePath = Path.Combine(commonIoTestDataPath, "StructuresWithDuplicateIrrelevantParameterInCsv", + "Kunstwerken.shp"); + + var messageProvider = mocks.Stub(); + var strategy = mocks.StrictMock>(); + strategy.Expect(s => s.UpdateStructuresWithImportedData(null, null, null)).IgnoreArguments() + .WhenCalled(invocation => + { + Assert.AreSame(invocation.Arguments[0], importTarget); + Assert.AreSame(invocation.Arguments[2], filePath); + + var readStructures = (IEnumerable) invocation.Arguments[1]; + Assert.AreEqual(1, readStructures.Count()); + }) + .Return(Enumerable.Empty()); + mocks.ReplayAll(); + + var referencePoints = new List + { + new Point2D(154493.618, 568995.991), + new Point2D(156844.169, 574771.498), + new Point2D(157910.502, 579115.458), + new Point2D(163625.153, 585151.261) + }; + var referenceLine = new ReferenceLine(); + referenceLine.SetGeometry(referencePoints); + + var importer = new HeightStructuresImporter(importTarget, referenceLine, filePath, + messageProvider, strategy); + + // Call + bool importResult = importer.Import(); + + // Assert + Assert.IsTrue(importResult); + } + + [Test] public void Import_CancelOfImportWhenReadingShapeFile_CancelsImportAndLogs() { // Setup Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/StabilityPointStructuresImporter.cs =================================================================== diff -u -r0e8c9f3912451d121375b590426837a3e6683dc5 -rce36fdd8e9af2866739cc67c82ea820f51533777 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/StabilityPointStructuresImporter.cs (.../StabilityPointStructuresImporter.cs) (revision 0e8c9f3912451d121375b590426837a3e6683dc5) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/StabilityPointStructuresImporter.cs (.../StabilityPointStructuresImporter.cs) (revision ce36fdd8e9af2866739cc67c82ea820f51533777) @@ -73,7 +73,9 @@ ThrowValidationErrorForStructure(structureLocation.Name, structureLocation.Id, parameterRowsValidationResult.ErrorMessages); } - StabilityPointStructure stabilityPointStructure = CreateStabilityPointStructure(structureLocation, structureParameterRows); + IEnumerable stabilityPointStructureParameters = + StructuresParameterRowsValidator.GetRelevantStabilityPointStructuresParameters(structureParameterRows); + StabilityPointStructure stabilityPointStructure = CreateStabilityPointStructure(structureLocation, stabilityPointStructureParameters); stabilityPointStructures.Add(stabilityPointStructure); } return stabilityPointStructures; Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/StabilityPointStructuresImporterTest.cs =================================================================== diff -u -rf28e5c177128224ea84257a3f29677f38b51f33f -rce36fdd8e9af2866739cc67c82ea820f51533777 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/StabilityPointStructuresImporterTest.cs (.../StabilityPointStructuresImporterTest.cs) (revision f28e5c177128224ea84257a3f29677f38b51f33f) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/StabilityPointStructuresImporterTest.cs (.../StabilityPointStructuresImporterTest.cs) (revision ce36fdd8e9af2866739cc67c82ea820f51533777) @@ -23,6 +23,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using Core.Common.Base; using Core.Common.Base.Geometry; using Core.Common.TestUtil; using NUnit.Framework; @@ -330,6 +331,48 @@ Assert.IsTrue(importResult); } + [Test] + public void Import_AllParameterIdsDefinedAndDuplicateUnknownParameterId_TrueAndImportTargetUpdated() + { + // Setup + var importTarget = new StructureCollection(); + string filePath = Path.Combine(commonIoTestDataPath, "StructuresWithDuplicateIrrelevantParameterInCsv", + "Kunstwerken.shp"); + + var messageProvider = mocks.Stub(); + var strategy = mocks.StrictMock>(); + strategy.Expect(s => s.UpdateStructuresWithImportedData(null, null, null)).IgnoreArguments() + .WhenCalled(invocation => + { + Assert.AreSame(invocation.Arguments[0], importTarget); + Assert.AreSame(invocation.Arguments[2], filePath); + + var readStructures = (IEnumerable) invocation.Arguments[1]; + Assert.AreEqual(1, readStructures.Count()); + }) + .Return(Enumerable.Empty()); + mocks.ReplayAll(); + + var referencePoints = new List + { + new Point2D(154493.618, 568995.991), + new Point2D(156844.169, 574771.498), + new Point2D(157910.502, 579115.458), + new Point2D(163625.153, 585151.261) + }; + var referenceLine = new ReferenceLine(); + referenceLine.SetGeometry(referencePoints); + + var importer = new StabilityPointStructuresImporter(importTarget, referenceLine, filePath, + messageProvider, strategy); + + // Call + bool importResult = importer.Import(); + + // Assert + Assert.IsTrue(importResult); + } + private static ReferenceLine CreateReferenceLine() { var referencePoints = new List