Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/StabilityPointStructuresImporterTest.cs =================================================================== diff -u -r4729996da3de69c24738bc39a0ee95fb3909e0c8 -r638081278e33e132e3ffedd52fff0d6c00ab4728 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/StabilityPointStructuresImporterTest.cs (.../StabilityPointStructuresImporterTest.cs) (revision 4729996da3de69c24738bc39a0ee95fb3909e0c8) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/StabilityPointStructuresImporterTest.cs (.../StabilityPointStructuresImporterTest.cs) (revision 638081278e33e132e3ffedd52fff0d6c00ab4728) @@ -23,11 +23,11 @@ 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; using Rhino.Mocks; +using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.IO.FileImporters; @@ -43,7 +43,7 @@ private readonly string commonIoTestDataPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, "Structures"); private readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.StabilityPointStructures.IO); - private readonly ObservableList testImportTarget = new ObservableList(); + private readonly StructureCollection testImportTarget = new StructureCollection(); private readonly ReferenceLine testReferenceLine = new ReferenceLine(); private readonly string testFilePath = string.Empty; @@ -72,7 +72,7 @@ var importer = new StabilityPointStructuresImporter(testImportTarget, testReferenceLine, testFilePath, messageProvider); // Assert - Assert.IsInstanceOf>>(importer); + Assert.IsInstanceOf>>(importer); } [Test] @@ -85,7 +85,7 @@ string filePath = Path.Combine(commonIoTestDataPath, "CorrectFiles", "Kunstwerken.shp"); ReferenceLine referenceLine = CreateReferenceLine(); - var importTarget = new ObservableList(); + var importTarget = new StructureCollection(); var structuresImporter = new StabilityPointStructuresImporter(importTarget, referenceLine, filePath, messageProvider); // Call @@ -114,7 +114,8 @@ ReferenceLine referenceLine = CreateReferenceLine(); - var importTarget = new ObservableList(); + var importTarget = new StructureCollection(); + ; var structuresImporter = new StabilityPointStructuresImporter(importTarget, referenceLine, filePath, messageProvider); // Call @@ -178,7 +179,8 @@ string filePath = Path.Combine(commonIoTestDataPath, "CorrectShpIncompleteCsv", "Kunstwerken.shp"); ReferenceLine referenceLine = CreateReferenceLine(); - var importTarget = new ObservableList(); + var importTarget = new StructureCollection(); + ; var structuresImporter = new StabilityPointStructuresImporter(importTarget, referenceLine, filePath, messageProvider); // Call @@ -217,7 +219,7 @@ }; var referenceLine = new ReferenceLine(); referenceLine.SetGeometry(referencePoints); - var importTarget = new ObservableList(); + var importTarget = new StructureCollection(); var structuresImporter = new StabilityPointStructuresImporter(importTarget, referenceLine, filePath, messageProvider); // Call @@ -239,7 +241,7 @@ ReferenceLine referenceLine = CreateReferenceLine(); - var importTarget = new ObservableList(); + var importTarget = new StructureCollection(); var structuresImporter = new StabilityPointStructuresImporter(importTarget, referenceLine, filePath, messageProvider); // Call @@ -278,11 +280,11 @@ } [Test] - public void Import_StructureWithSameIdAlreadyImporterd_FalseAndImportTargetNotUpdated() + public void Import_StructureWithSameIdAlreadyImported_FalseAndImportTargetNotUpdated() { // Setup var messageProvider = mocks.Stub(); - var errorText = "Failed"; + const string errorText = "Failed"; messageProvider.Stub(m => m.GetUpdateDataFailedLogMessageText(null)).IgnoreArguments().Return(errorText); messageProvider.Stub(m => m.GetAddDataToModelProgressText()).Return("Progress"); mocks.ReplayAll(); @@ -298,11 +300,12 @@ }; var referenceLine = new ReferenceLine(); referenceLine.SetGeometry(referencePoints); - var importTarget = new ObservableList + var importTarget = new StructureCollection(); + importTarget.AddRange(new[] { new TestStabilityPointStructure("KWK_3"), new TestStabilityPointStructure("KWK_4") - }; + }, filePath); var structuresImporter = new StabilityPointStructuresImporter(importTarget, referenceLine, filePath, messageProvider); var importResult = true;