Index: Core/Common/test/Core.Common.TestUtil.Test/TestHelperTest.cs =================================================================== diff -u -r3a6d1b189a1d8aa952c6c1e45171a874977f5148 -r6ba0018b986ebbdcbbcc33538b44fe3a31960ab4 --- Core/Common/test/Core.Common.TestUtil.Test/TestHelperTest.cs (.../TestHelperTest.cs) (revision 3a6d1b189a1d8aa952c6c1e45171a874977f5148) +++ Core/Common/test/Core.Common.TestUtil.Test/TestHelperTest.cs (.../TestHelperTest.cs) (revision 6ba0018b986ebbdcbbcc33538b44fe3a31960ab4) @@ -268,6 +268,8 @@ path = TestHelper.GetTestDataPath(TestDataPath.Riskeer.StabilityPointStructures.IO); Assert.IsTrue(Directory.Exists(path)); + path = TestHelper.GetTestDataPath(TestDataPath.Riskeer.StabilityPointStructures.Integration); + Assert.IsTrue(Directory.Exists(path)); path = TestHelper.GetTestDataPath(TestDataPath.Riskeer.StabilityStoneCover.IO); Assert.IsTrue(Directory.Exists(path)); @@ -283,10 +285,10 @@ public void ToUncPath_InvalidPath_ThrowArgumentException(string invalidPath) { // Call - TestDelegate call = () => TestHelper.ToUncPath(invalidPath); + void Call() => TestHelper.ToUncPath(invalidPath); // Assert - Assert.Throws(call); + Assert.Throws(Call); } [Test] @@ -296,12 +298,12 @@ string unrootedPath = Path.Combine("a", "b.c"); // Call - TestDelegate call = () => TestHelper.ToUncPath(unrootedPath); + void Call() => TestHelper.ToUncPath(unrootedPath); // Assert const string expectedMessage = "Must be a rooted path."; - string paramName = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage).ParamName; - Assert.AreEqual("rootedPath", paramName); + var exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(Call, expectedMessage); + Assert.AreEqual("rootedPath", exception.ParamName); } [Test] Index: Core/Common/test/Core.Common.TestUtil/TestDataPath.cs =================================================================== diff -u -r3a6d1b189a1d8aa952c6c1e45171a874977f5148 -r6ba0018b986ebbdcbbcc33538b44fe3a31960ab4 --- Core/Common/test/Core.Common.TestUtil/TestDataPath.cs (.../TestDataPath.cs) (revision 3a6d1b189a1d8aa952c6c1e45171a874977f5148) +++ Core/Common/test/Core.Common.TestUtil/TestDataPath.cs (.../TestDataPath.cs) (revision 6ba0018b986ebbdcbbcc33538b44fe3a31960ab4) @@ -127,6 +127,7 @@ public static class StabilityPointStructures { public static readonly TestDataPath IO = "Riskeer.StabilityPointStructures.IO.Test"; + public static readonly TestDataPath Integration = "Riskeer.StabilityPointStructures.Integration.Test"; } public static class StabilityStoneCover Index: Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Plugin/FileImporters/StabilityPointStructureReplaceDataStrategy.cs =================================================================== diff -u --- Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Plugin/FileImporters/StabilityPointStructureReplaceDataStrategy.cs (revision 0) +++ Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Plugin/FileImporters/StabilityPointStructureReplaceDataStrategy.cs (revision 6ba0018b986ebbdcbbcc33538b44fe3a31960ab4) @@ -0,0 +1,59 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Base; +using Riskeer.Common.Data.UpdateDataStrategies; +using Riskeer.Common.IO.Structures; +using Riskeer.StabilityPointStructures.Data; +using Riskeer.StabilityPointStructures.Service; + +namespace Riskeer.StabilityPointStructures.Plugin.FileImporters +{ + /// + /// An + /// to replace stability point structures with the imported stability point structures + /// + public class StabilityPointStructureReplaceDataStrategy : ReplaceDataStrategyBase, + IStructureUpdateStrategy + { + /// + /// Creates a new instance of . + /// + /// The failure mechanism in which the + /// structures are updated. + /// Thrown when + /// is null. + public StabilityPointStructureReplaceDataStrategy(StabilityPointStructuresFailureMechanism failureMechanism) + : base(failureMechanism, failureMechanism?.StabilityPointStructures) {} + + public IEnumerable UpdateStructuresWithImportedData(IEnumerable readStructures, string sourceFilePath) + { + return ReplaceTargetCollectionWithImportedData(readStructures, sourceFilePath); + } + + protected override IEnumerable ClearData() + { + return StabilityPointStructuresDataSynchronizationService.RemoveAllStructures(FailureMechanism); + } + } +} \ No newline at end of file Fisheye: Tag 6ba0018b986ebbdcbbcc33538b44fe3a31960ab4 refers to a dead (removed) revision in file `Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Plugin/FileImporters/StabilityPointStructureReplaceStrategy.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs =================================================================== diff -u -red53a0191c99f145f92dc3fff3c419e11be2e769 -r6ba0018b986ebbdcbbcc33538b44fe3a31960ab4 --- Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs (.../StabilityPointStructuresPlugin.cs) (revision ed53a0191c99f145f92dc3fff3c419e11be2e769) +++ Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs (.../StabilityPointStructuresPlugin.cs) (revision 6ba0018b986ebbdcbbcc33538b44fe3a31960ab4) @@ -206,7 +206,7 @@ context, filePath, new ImportMessageProvider(), - new StabilityPointStructureReplaceStrategy(context.FailureMechanism)), + new StabilityPointStructureReplaceDataStrategy(context.FailureMechanism)), Name = RiskeerCommonFormsResources.StructuresImporter_DisplayName, Category = RiskeerCommonFormsResources.Riskeer_Category, Image = RiskeerCommonFormsResources.StructuresIcon, Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/Riskeer.StabilityPointStructures.Integration.Test.csproj =================================================================== diff -u -rbfc6cb5bd6fbe03ebcf7abae66fdac10bd298fd8 -r6ba0018b986ebbdcbbcc33538b44fe3a31960ab4 --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/Riskeer.StabilityPointStructures.Integration.Test.csproj (.../Riskeer.StabilityPointStructures.Integration.Test.csproj) (revision bfc6cb5bd6fbe03ebcf7abae66fdac10bd298fd8) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/Riskeer.StabilityPointStructures.Integration.Test.csproj (.../Riskeer.StabilityPointStructures.Integration.Test.csproj) (revision 6ba0018b986ebbdcbbcc33538b44fe3a31960ab4) @@ -1,8 +1,17 @@  + + + + + + + ..\..\..\..\lib\NUnitForms.dll + + @@ -21,6 +30,8 @@ + + Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/StabilityPointStructuresScenariosViewIntegrationTest.cs =================================================================== diff -u --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/StabilityPointStructuresScenariosViewIntegrationTest.cs (revision 0) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/StabilityPointStructuresScenariosViewIntegrationTest.cs (revision 6ba0018b986ebbdcbbcc33538b44fe3a31960ab4) @@ -0,0 +1,275 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.IO; +using System.Linq; +using System.Windows.Forms; +using Core.Common.Base.Data; +using Core.Common.TestUtil; +using NUnit.Extensions.Forms; +using NUnit.Framework; +using Rhino.Mocks; +using Riskeer.Common.Data.AssessmentSection; +using Riskeer.Common.Data.Calculation; +using Riskeer.Common.Data.FailureMechanism; +using Riskeer.Common.Data.Structures; +using Riskeer.Common.Forms.Helpers; +using Riskeer.Common.IO.FileImporters.MessageProviders; +using Riskeer.Integration.Data; +using Riskeer.Integration.TestUtil; +using Riskeer.StabilityPointStructures.Data; +using Riskeer.StabilityPointStructures.Forms.Views; +using Riskeer.StabilityPointStructures.IO; +using Riskeer.StabilityPointStructures.Plugin.FileImporters; + +namespace Riskeer.StabilityPointStructures.Integration.Test +{ + [TestFixture] + public class StabilityPointStructuresScenariosViewIntegrationTest + { + private const int isRelevantColumnIndex = 0; + private const int contributionColumnIndex = 1; + private const int nameColumnIndex = 2; + private const int failureProbabilityColumnIndex = 3; + + private readonly string filePath = TestHelper.GetTestDataPath(TestDataPath.Riskeer.StabilityPointStructures.Integration, + Path.Combine("StabilityPointStructures", "kunstwerken_6_3.shp")); + + [Test] + public void ScenariosView_ImportFailureMechanismSections_ChangesCorrectlyObservedAndSynced() + { + // Setup + using (var form = new Form()) + { + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + DataImportHelper.ImportReferenceLine(assessmentSection); + + var view = new StabilityPointStructuresScenariosView(assessmentSection.StabilityPointStructures.CalculationsGroup, assessmentSection.StabilityPointStructures, assessmentSection); + form.Controls.Add(view); + form.Show(); + + var listBox = (ListBox) new ControlTester("listBox").TheObject; + + // Precondition + CollectionAssert.IsEmpty(listBox.Items); + + // Call + IFailureMechanism failureMechanism = assessmentSection.StabilityPointStructures; + DataImportHelper.ImportFailureMechanismSections(assessmentSection, failureMechanism); + assessmentSection.StabilityPointStructures.NotifyObservers(); + + // Assert + CollectionAssert.AreEqual(assessmentSection.StabilityPointStructures.Sections, listBox.Items); + } + } + + [Test] + public void ScenariosView_GenerateCalculations_ChangesCorrectlyObservedAndSynced() + { + // Setup + var mocks = new MockRepository(); + var messageProvider = mocks.Stub(); + mocks.ReplayAll(); + + using (var form = new Form()) + { + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + DataImportHelper.ImportReferenceLine(assessmentSection); + StabilityPointStructuresFailureMechanism failureMechanism = assessmentSection.StabilityPointStructures; + DataImportHelper.ImportFailureMechanismSections(assessmentSection, failureMechanism); + + CalculationGroup calculationsGroup = assessmentSection.StabilityPointStructures.CalculationsGroup; + var view = new StabilityPointStructuresScenariosView(calculationsGroup, assessmentSection.StabilityPointStructures, assessmentSection); + + form.Controls.Add(view); + form.Show(); + + var structuresImporter = new StabilityPointStructuresImporter(assessmentSection.StabilityPointStructures.StabilityPointStructures, + assessmentSection.ReferenceLine, filePath, messageProvider, + new StabilityPointStructureReplaceDataStrategy(failureMechanism)); + structuresImporter.Import(); + + var listBox = (ListBox) new ControlTester("listBox").TheObject; + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; + + listBox.SelectedItem = failureMechanism.Sections.ElementAt(50); + + // Precondition + DataGridViewRowCollection rows = dataGridView.Rows; + CollectionAssert.IsEmpty(rows); + + // Call + foreach (StabilityPointStructure structure in assessmentSection.StabilityPointStructures.StabilityPointStructures) + { + calculationsGroup.Children.Add(new StructuresCalculationScenario + { + Name = NamingHelper.GetUniqueName(((CalculationGroup) view.Data).Children, structure.Name, c => c.Name), + InputParameters = + { + Structure = structure + } + }); + } + + calculationsGroup.NotifyObservers(); + + // Assert + Assert.AreEqual(1, rows.Count); + + DataGridViewCellCollection cells = rows[0].Cells; + Assert.AreEqual(4, cells.Count); + Assert.IsTrue(Convert.ToBoolean(cells[isRelevantColumnIndex].FormattedValue)); + Assert.AreEqual(new RoundedDouble(2, 100).ToString(), cells[contributionColumnIndex].FormattedValue); + Assert.AreEqual("Eerste kunstwerk punt 6-3", cells[nameColumnIndex].FormattedValue); + Assert.AreEqual("-", cells[failureProbabilityColumnIndex].FormattedValue); + } + + mocks.VerifyAll(); + } + + [Test] + public void ScenariosView_RenameCalculations_ChangesCorrectlyObservedAndSynced() + { + // Setup + var mocks = new MockRepository(); + var messageProvider = mocks.Stub(); + mocks.ReplayAll(); + + using (var form = new Form()) + { + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + DataImportHelper.ImportReferenceLine(assessmentSection); + StabilityPointStructuresFailureMechanism failureMechanism = assessmentSection.StabilityPointStructures; + DataImportHelper.ImportFailureMechanismSections(assessmentSection, failureMechanism); + + CalculationGroup calculationsGroup = assessmentSection.StabilityPointStructures.CalculationsGroup; + var view = new StabilityPointStructuresScenariosView(calculationsGroup, assessmentSection.StabilityPointStructures, assessmentSection); + + form.Controls.Add(view); + form.Show(); + + var structuresImporter = new StabilityPointStructuresImporter(assessmentSection.StabilityPointStructures.StabilityPointStructures, + assessmentSection.ReferenceLine, filePath, messageProvider, + new StabilityPointStructureReplaceDataStrategy(failureMechanism)); + structuresImporter.Import(); + + foreach (StabilityPointStructure structure in assessmentSection.StabilityPointStructures.StabilityPointStructures) + { + calculationsGroup.Children.Add(new StructuresCalculationScenario + { + Name = NamingHelper.GetUniqueName(calculationsGroup.Children, structure.Name, c => c.Name), + InputParameters = + { + Structure = structure + } + }); + } + + calculationsGroup.NotifyObservers(); + + var listBox = (ListBox) new ControlTester("listBox").TheObject; + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; + + listBox.SelectedItem = failureMechanism.Sections.ElementAt(50); + + // Precondition + DataGridViewRowCollection rows = dataGridView.Rows; + Assert.AreEqual(1, rows.Count); + + DataGridViewCellCollection cells = rows[0].Cells; + Assert.AreEqual("Eerste kunstwerk punt 6-3", cells[nameColumnIndex].FormattedValue); + + // Call + foreach (StructuresCalculationScenario calculation in calculationsGroup.Children.Cast>()) + { + calculation.Name += "_changed"; + } + + // Assert + Assert.AreEqual("Eerste kunstwerk punt 6-3_changed", cells[nameColumnIndex].FormattedValue); + } + + mocks.VerifyAll(); + } + + [Test] + public void ScenariosView_ChangeStructureOfCalculation_ChangesCorrectlyObservedAndSynced() + { + // Setup + var mocks = new MockRepository(); + var messageProvider = mocks.Stub(); + mocks.ReplayAll(); + + using (var form = new Form()) + { + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + DataImportHelper.ImportReferenceLine(assessmentSection); + StabilityPointStructuresFailureMechanism failureMechanism = assessmentSection.StabilityPointStructures; + DataImportHelper.ImportFailureMechanismSections(assessmentSection, failureMechanism); + + var view = new StabilityPointStructuresScenariosView(assessmentSection.StabilityPointStructures.CalculationsGroup, assessmentSection.StabilityPointStructures, assessmentSection); + form.Controls.Add(view); + form.Show(); + + var structuresImporter = new StabilityPointStructuresImporter(assessmentSection.StabilityPointStructures.StabilityPointStructures, + assessmentSection.ReferenceLine, filePath, messageProvider, + new StabilityPointStructureReplaceDataStrategy(failureMechanism)); + structuresImporter.Import(); + + foreach (StabilityPointStructure structure in assessmentSection.StabilityPointStructures.StabilityPointStructures) + { + assessmentSection.StabilityPointStructures.CalculationsGroup.Children.Add(new StructuresCalculationScenario + { + Name = NamingHelper.GetUniqueName(assessmentSection.StabilityPointStructures.CalculationsGroup.Children, structure.Name + "Calculation", c => c.Name), + InputParameters = + { + Structure = structure + } + }); + } + + var listBox = (ListBox) new ControlTester("listBox").TheObject; + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; + + listBox.SelectedItem = failureMechanism.Sections.ElementAt(50); + + // Precondition + DataGridViewRowCollection rows = dataGridView.Rows; + Assert.AreEqual(1, rows.Count); + Assert.AreEqual("Eerste kunstwerk punt 6-3Calculation", rows[0].Cells[nameColumnIndex].FormattedValue); + + // Call + CalculationGroup calculationsGroup = assessmentSection.StabilityPointStructures.CalculationsGroup; + ((StructuresCalculation) calculationsGroup.Children[1]).InputParameters.Structure = + ((StructuresCalculation) calculationsGroup.Children[0]).InputParameters.Structure; + calculationsGroup.NotifyObservers(); + + // Assert + Assert.AreEqual(2, rows.Count); + Assert.AreEqual("Eerste kunstwerk punt 6-3Calculation", rows[0].Cells[nameColumnIndex].FormattedValue); + Assert.AreEqual("Tweede kunstwerk punt 6-3Calculation", rows[1].Cells[nameColumnIndex].FormattedValue); + } + + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/test-data/StabilityPointStructures/kunstwerken_6_3..prj =================================================================== diff -u --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/test-data/StabilityPointStructures/kunstwerken_6_3..prj (revision 0) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/test-data/StabilityPointStructures/kunstwerken_6_3..prj (revision 6ba0018b986ebbdcbbcc33538b44fe3a31960ab4) @@ -0,0 +1 @@ +PROJCS["Amersfoort_RD_New",GEOGCS["GCS_Amersfoort",DATUM["D_Amersfoort",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Double_Stereographic"],PARAMETER["latitude_of_origin",52.15616055555555],PARAMETER["central_meridian",5.38763888888889],PARAMETER["scale_factor",0.9999079],PARAMETER["false_easting",155000],PARAMETER["false_northing",463000],UNIT["Meter",1]] \ No newline at end of file Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/test-data/StabilityPointStructures/kunstwerken_6_3.csv =================================================================== diff -u --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/test-data/StabilityPointStructures/kunstwerken_6_3.csv (revision 0) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/test-data/StabilityPointStructures/kunstwerken_6_3.csv (revision 6ba0018b986ebbdcbbcc33538b44fe3a31960ab4) @@ -0,0 +1,105 @@ +Identificatie;Kunstwerken.identificatie;AlfanumeriekeWaarde;NumeriekeWaarde;Standaardafwijking.variatie;Boolean +KWK_1;KW_STERSTAB1; ; 10.11; 0;0 +KWK_1;KW_STERSTAB2; ; 20000.11; 0.1;0 +KWK_1;KW_STERSTAB3; ; 0.81; 0.1;1 +KWK_1;KW_STERSTAB4; ; 21.11; 0.05;0 +KWK_1;KW_STERSTAB5; ; 0.71; 0.1;1 +KWK_1;KW_STERSTAB6; ; 4.11; 0.1;1 +KWK_1;KW_STERSTAB7; ; 1.11; 0.15;0 +KWK_1;KW_STERSTAB8; ; 25.11; 0.05;0 +KWK_1;KW_STERSTAB9; ; 11.11; 0.1;0 +KWK_1;KW_STERSTAB10; ; 10.11; 0.1;0 +KWK_1;KW_STERSTAB11; ; 0.11; 0;1 +KWK_1;KW_STERSTAB12; ; 0.51; 0.1;1 +KWK_1;KW_STERSTAB13; ; 0.21; 0;0 +KWK_1;KW_STERSTAB14; ; 4.91; 0.05;1 +KWK_1;KW_STERSTAB15; ; 0.11; 0;0 +KWK_1;KW_STERSTAB16; ; 0.09; 0;0 +KWK_1;KW_STERSTAB17; ; 10.11; 0.3;0 +KWK_1;KW_STERSTAB18; ; 16000.11; 0.2;0 +KWK_1;KW_STERSTAB19; ; 2.11; 0.2;0 +KWK_1;KW_STERSTAB20; ; 11; 0;0 +KWK_1;KW_STERSTAB21; ; 0.10; 0;0 +KWK_1;KW_STERSTAB22; ; 3.11; 1;1 +KWK_1;KW_STERSTAB23; ; 15.11; 0.1;0 +KWK_1;KW_STERSTAB24; ; 17.11; 0.1;0 +KWK_1;KW_STERSTAB25; ; 2.51; 0.01;1 +KWK_1;KW_STERSTAB26;VerdronkenKoker; ; ; +KWK_2;KW_STERSTAB1; ; 10.22; 0;0 +KWK_2;KW_STERSTAB2; ; 20000.22; 0.1;0 +KWK_2;KW_STERSTAB3; ; 0.82; 0.1;1 +KWK_2;KW_STERSTAB4; ; 21.22; 0.05;0 +KWK_2;KW_STERSTAB5; ; 0.72; 0.1;1 +KWK_2;KW_STERSTAB6; ; 4.22; 0.1;1 +KWK_2;KW_STERSTAB7; ; 1.22; 0.15;0 +KWK_2;KW_STERSTAB8; ; 25.22; 0.05;0 +KWK_2;KW_STERSTAB9; ; 11.22; 0.1;0 +KWK_2;KW_STERSTAB10; ; 10.22; 0.1;0 +KWK_2;KW_STERSTAB11; ; 0.22; 0;1 +KWK_2;KW_STERSTAB12; ; 0.52; 0.1;1 +KWK_2;KW_STERSTAB13; ; 0.22; 0;0 +KWK_2;KW_STERSTAB14; ; 4.92; 0.05;1 +KWK_2;KW_STERSTAB15; ; 0.22; 0;0 +KWK_2;KW_STERSTAB16; ;0.0454545; 0;0 +KWK_2;KW_STERSTAB17; ; 10.22; 0.3;0 +KWK_2;KW_STERSTAB18; ; 16000.22; 0.2;0 +KWK_2;KW_STERSTAB19; ; 2.22; 0.2;0 +KWK_2;KW_STERSTAB20; ; 22; 0;0 +KWK_2;KW_STERSTAB21; ; 0.05; 0;0 +KWK_2;KW_STERSTAB22; ; 3.22; 1;1 +KWK_2;KW_STERSTAB23; ; 15.22; 0.1;0 +KWK_2;KW_STERSTAB24; ; 17.22; 0.1;0 +KWK_2;KW_STERSTAB25; ; 2.52; 0.01;1 +KWK_2;KW_STERSTAB26;LageDrempel; ; ; +KWK_3;KW_STERSTAB1; ; 10.33; 0;0 +KWK_3;KW_STERSTAB2; ; 20000.33; 0.1;0 +KWK_3;KW_STERSTAB3; ; 0.83; 0.1;1 +KWK_3;KW_STERSTAB4; ; 21.33; 0.05;0 +KWK_3;KW_STERSTAB5; ; 0.73; 0.1;1 +KWK_3;KW_STERSTAB6; ; 4.33; 0.1;1 +KWK_3;KW_STERSTAB7; ; 1.33; 0.15;0 +KWK_3;KW_STERSTAB8; ; 25.33; 0.05;0 +KWK_3;KW_STERSTAB9; ; 11.33; 0.1;0 +KWK_3;KW_STERSTAB10; ; 10.33; 0.1;0 +KWK_3;KW_STERSTAB11; ; 0.33; 0;1 +KWK_3;KW_STERSTAB12; ; 0.53; 0.1;1 +KWK_3;KW_STERSTAB13; ; 0.23; 0;0 +KWK_3;KW_STERSTAB14; ; 4.93; 0.05;1 +KWK_3;KW_STERSTAB15; ; 0.33; 0;0 +KWK_3;KW_STERSTAB16; ; 0.030303; 0;0 +KWK_3;KW_STERSTAB17; ; 10.33; 0.3;0 +KWK_3;KW_STERSTAB18; ; 16000.33; 0.2;0 +KWK_3;KW_STERSTAB19; ; 2.33; 0.2;0 +KWK_3;KW_STERSTAB20; ; 33; 0;0 +KWK_3;KW_STERSTAB21; ; 0.0333; 0;0 +KWK_3;KW_STERSTAB22; ; 3.33; 1;1 +KWK_3;KW_STERSTAB23; ; 15.33; 0.1;0 +KWK_3;KW_STERSTAB24; ; 17.33; 0.1;0 +KWK_3;KW_STERSTAB25; ; 2.53; 0.01;1 +KWK_3;KW_STERSTAB26;VerdronkenKoker; ; ; +KWK_4;KW_STERSTAB1; ; 10.44; 0;0 +KWK_4;KW_STERSTAB2; ; 20000.44; 0.1;0 +KWK_4;KW_STERSTAB3; ; 0.84; 0.1;1 +KWK_4;KW_STERSTAB4; ; 21.44; 0.05;0 +KWK_4;KW_STERSTAB5; ; 0.74; 0.1;1 +KWK_4;KW_STERSTAB6; ; 4.44; 0.1;1 +KWK_4;KW_STERSTAB7; ; 1.44; 0.15;0 +KWK_4;KW_STERSTAB8; ; 25.44; 0.05;0 +KWK_4;KW_STERSTAB9; ; 11.44; 0.1;0 +KWK_4;KW_STERSTAB10; ; 10.44; 0.1;0 +KWK_4;KW_STERSTAB11; ; 0.44; 0;1 +KWK_4;KW_STERSTAB12; ; 0.54; 0.1;1 +KWK_4;KW_STERSTAB13; ; 0.24; 0;0 +KWK_4;KW_STERSTAB14; ; 4.94; 0.05;1 +KWK_4;KW_STERSTAB15; ; 0.44; 0;0 +KWK_4;KW_STERSTAB16; ; 0.022727; 0;0 +KWK_4;KW_STERSTAB17; ; 10.44; 0.3;0 +KWK_4;KW_STERSTAB18; ; 16000.44; 0.2;0 +KWK_4;KW_STERSTAB19; ; 2.44; 0.2;0 +KWK_4;KW_STERSTAB20; ; 44; 0;0 +KWK_4;KW_STERSTAB21; ; 0.025; 0;0 +KWK_4;KW_STERSTAB22; ; 3.44; 1;1 +KWK_4;KW_STERSTAB23; ; 15.44; 0.1;0 +KWK_4;KW_STERSTAB24; ; 17.44; 0.1;0 +KWK_4;KW_STERSTAB25; ; 2.54; 0.01;1 +KWK_4;KW_STERSTAB26;LageDrempel; ; ; Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/test-data/StabilityPointStructures/kunstwerken_6_3.dbf =================================================================== diff -u Binary files differ Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/test-data/StabilityPointStructures/kunstwerken_6_3.qpj =================================================================== diff -u --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/test-data/StabilityPointStructures/kunstwerken_6_3.qpj (revision 0) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/test-data/StabilityPointStructures/kunstwerken_6_3.qpj (revision 6ba0018b986ebbdcbbcc33538b44fe3a31960ab4) @@ -0,0 +1 @@ +PROJCS["Amersfoort / RD New",GEOGCS["Amersfoort",DATUM["Amersfoort",SPHEROID["Bessel 1841",6377397.155,299.1528128,AUTHORITY["EPSG","7004"]],TOWGS84[565.4171,50.3319,465.5524,-0.398957,0.343988,-1.87740,4.0725],AUTHORITY["EPSG","6289"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4289"]],PROJECTION["Oblique_Stereographic"],PARAMETER["latitude_of_origin",52.15616055555555],PARAMETER["central_meridian",5.38763888888889],PARAMETER["scale_factor",0.9999079],PARAMETER["false_easting",155000],PARAMETER["false_northing",463000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","28992"]] Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/test-data/StabilityPointStructures/kunstwerken_6_3.shp =================================================================== diff -u Binary files differ Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Integration.Test/test-data/StabilityPointStructures/kunstwerken_6_3.shx =================================================================== diff -u Binary files differ Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/FileImporters/StabilityPointStructureReplaceDataStrategyTest.cs =================================================================== diff -u -rb0021e52ef17e3101d6e7089e3052ceb4621f3fe -r6ba0018b986ebbdcbbcc33538b44fe3a31960ab4 --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/FileImporters/StabilityPointStructureReplaceDataStrategyTest.cs (.../StabilityPointStructureReplaceDataStrategyTest.cs) (revision b0021e52ef17e3101d6e7089e3052ceb4621f3fe) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/FileImporters/StabilityPointStructureReplaceDataStrategyTest.cs (.../StabilityPointStructureReplaceDataStrategyTest.cs) (revision 6ba0018b986ebbdcbbcc33538b44fe3a31960ab4) @@ -45,7 +45,7 @@ public void Constructor_WithFailureMechanismNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new StabilityPointStructureReplaceStrategy(null); + TestDelegate call = () => new StabilityPointStructureReplaceDataStrategy(null); // Assert var exception = Assert.Throws(call); @@ -59,7 +59,7 @@ var failureMechanism = new StabilityPointStructuresFailureMechanism(); // Call - var strategy = new StabilityPointStructureReplaceStrategy(failureMechanism); + var strategy = new StabilityPointStructureReplaceDataStrategy(failureMechanism); // Assert Assert.IsInstanceOf strategy.UpdateStructuresWithImportedData(null, @@ -88,7 +88,7 @@ { // Setup var failureMechanism = new StabilityPointStructuresFailureMechanism(); - var strategy = new StabilityPointStructureReplaceStrategy(failureMechanism); + var strategy = new StabilityPointStructureReplaceDataStrategy(failureMechanism); // Call TestDelegate call = () => strategy.UpdateStructuresWithImportedData(Enumerable.Empty(), @@ -106,7 +106,7 @@ var failureMechanism = new StabilityPointStructuresFailureMechanism(); StructureCollection targetCollection = failureMechanism.StabilityPointStructures; - var strategy = new StabilityPointStructureReplaceStrategy(failureMechanism); + var strategy = new StabilityPointStructureReplaceDataStrategy(failureMechanism); var newSourcePath = "some/other/path/toStructures"; @@ -129,7 +129,7 @@ var failureMechanism = new StabilityPointStructuresFailureMechanism(); StructureCollection targetCollection = failureMechanism.StabilityPointStructures; - var strategy = new StabilityPointStructureReplaceStrategy(failureMechanism); + var strategy = new StabilityPointStructureReplaceDataStrategy(failureMechanism); // Call IEnumerable affectedObjects = strategy.UpdateStructuresWithImportedData(Enumerable.Empty(), @@ -155,7 +155,7 @@ new TestStabilityPointStructure(duplicateId, "Other name") }; - var strategy = new StabilityPointStructureReplaceStrategy(new StabilityPointStructuresFailureMechanism()); + var strategy = new StabilityPointStructureReplaceDataStrategy(new StabilityPointStructuresFailureMechanism()); // Call TestDelegate call = () => strategy.UpdateStructuresWithImportedData(importedClosingStructures, @@ -175,7 +175,7 @@ var failureMechanism = new StabilityPointStructuresFailureMechanism(); StructureCollection targetCollection = failureMechanism.StabilityPointStructures; - var strategy = new StabilityPointStructureReplaceStrategy(failureMechanism); + var strategy = new StabilityPointStructureReplaceDataStrategy(failureMechanism); var importedCollection = new[] { @@ -206,7 +206,7 @@ new TestStabilityPointStructure() }, sourcePath); - var strategy = new StabilityPointStructureReplaceStrategy(failureMechanism); + var strategy = new StabilityPointStructureReplaceDataStrategy(failureMechanism); // Call IEnumerable affectedObjects = strategy.UpdateStructuresWithImportedData(Enumerable.Empty(), @@ -234,7 +234,7 @@ var importedStructure = new TestStabilityPointStructure("a different id"); - var strategy = new StabilityPointStructureReplaceStrategy(failureMechanism); + var strategy = new StabilityPointStructureReplaceDataStrategy(failureMechanism); // Call IEnumerable affectedObjects = strategy.UpdateStructuresWithImportedData(new[] @@ -277,7 +277,7 @@ structure }, sourcePath); - var strategy = new StabilityPointStructureReplaceStrategy(failureMechanism); + var strategy = new StabilityPointStructureReplaceDataStrategy(failureMechanism); // Call IEnumerable affectedObjects = strategy.UpdateStructuresWithImportedData(Enumerable.Empty(), @@ -318,7 +318,7 @@ structure }, sourcePath); - var strategy = new StabilityPointStructureReplaceStrategy(failureMechanism); + var strategy = new StabilityPointStructureReplaceDataStrategy(failureMechanism); // Call IEnumerable affectedObjects = strategy.UpdateStructuresWithImportedData(Enumerable.Empty(), @@ -370,7 +370,7 @@ structure }, sourcePath); - var strategy = new StabilityPointStructureReplaceStrategy(failureMechanism); + var strategy = new StabilityPointStructureReplaceDataStrategy(failureMechanism); // Call IEnumerable affectedObjects = strategy.UpdateStructuresWithImportedData(Enumerable.Empty(),