Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismView.cs =================================================================== diff -u -r7019db1a51efdb9f1bd955015fcff3b756a8ed1f -r5ee23018be55ff03a7851e54ca0a6682c521f952 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismView.cs (.../ClosingStructuresFailureMechanismView.cs) (revision 7019db1a51efdb9f1bd955015fcff3b756a8ed1f) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismView.cs (.../ClosingStructuresFailureMechanismView.cs) (revision 5ee23018be55ff03a7851e54ca0a6682c521f952) @@ -85,16 +85,16 @@ UpdateMapData(); }); - hydraulicBoundaryDatabaseObserver = new Observer(UpdateHydraulicBoundaryLocationsMapData); - foreshoreProfilesObserver = new Observer(UpdateForeshoreProfilesMapData); - structuresObserver = new Observer(UpdateStructuresMapData); + hydraulicBoundaryDatabaseObserver = new Observer(UpdateMapData); + foreshoreProfilesObserver = new Observer(UpdateMapData); + structuresObserver = new Observer(UpdateMapData); calculationInputObserver = new RecursiveObserver( - UpdateCalculationsMapData, pcg => pcg.Children.Concat(pcg.Children.OfType>().Select(pc => pc.InputParameters))); - calculationGroupObserver = new RecursiveObserver(UpdateCalculationsMapData, pcg => pcg.Children); - calculationObserver = new RecursiveObserver>(UpdateCalculationsMapData, pcg => pcg.Children); - foreshoreProfileObserver = new RecursiveObserver(UpdateForeshoreProfilesMapData, coll => coll); - structureObserver = new RecursiveObserver, ClosingStructure>(UpdateStructuresMapData, coll => coll); + UpdateMapData, pcg => pcg.Children.Concat(pcg.Children.OfType>().Select(pc => pc.InputParameters))); + calculationGroupObserver = new RecursiveObserver(UpdateMapData, pcg => pcg.Children); + calculationObserver = new RecursiveObserver>(UpdateMapData, pcg => pcg.Children); + foreshoreProfileObserver = new RecursiveObserver(UpdateMapData, coll => coll); + structureObserver = new RecursiveObserver, ClosingStructure>(UpdateMapData, coll => coll); mapDataCollection = new MapDataCollection(ClosingStructuresDataResources.ClosingStructuresFailureMechanism_DisplayName); referenceLineMapData = RingtoetsMapDataFactory.CreateReferenceLineMapData(); @@ -154,7 +154,7 @@ calculationGroupObserver.Observable = data.WrappedData.CalculationsGroup; calculationObserver.Observable = data.WrappedData.CalculationsGroup; - SetAllMapDataFeatures(); + SetMapDataFeatures(); ringtoetsMapControl.SetAllData(mapDataCollection, data.Parent.BackgroundData); } @@ -191,127 +191,36 @@ private void UpdateMapData() { - UpdateCalculationsMapData(); - UpdateHydraulicBoundaryLocationsMapData(); - UpdateReferenceLineMapData(); - UpdateSectionsMapData(); - UpdateForeshoreProfilesMapData(); - UpdateStructuresMapData(); - } + SetMapDataFeatures(); - private void SetAllMapDataFeatures() - { - SetCalculationsMapData(); - SetHydraulicBoundaryLocationsMapData(); - SetReferenceLineMapData(); - SetSectionsMapData(); - SetForeshoreProfilesMapData(); - SetStructuresMapData(); - } - - #region Calculations MapData - - private void UpdateCalculationsMapData() - { - SetCalculationsMapData(); - calculationsMapData.NotifyObservers(); - } - - private void SetCalculationsMapData() - { - IEnumerable> calculations = - data.WrappedData.CalculationsGroup.GetCalculations().Cast>(); - calculationsMapData.Features = - RingtoetsMapDataFeaturesFactory.CreateStructureCalculationsFeatures(calculations); - } - - #endregion - - #region HydraulicBoundaryLocations MapData - - private void UpdateHydraulicBoundaryLocationsMapData() - { - SetHydraulicBoundaryLocationsMapData(); - hydraulicBoundaryLocationsMapData.NotifyObservers(); - } - - private void SetHydraulicBoundaryLocationsMapData() - { - HydraulicBoundaryDatabase hydraulicBoundaryDatabase = data.Parent.HydraulicBoundaryDatabase; - hydraulicBoundaryLocationsMapData.Features = - RingtoetsMapDataFeaturesFactory.CreateHydraulicBoundaryDatabaseFeatures(hydraulicBoundaryDatabase); - } - - #endregion - - #region ReferenceLine MapData - - private void UpdateReferenceLineMapData() - { - SetReferenceLineMapData(); referenceLineMapData.NotifyObservers(); - } - - private void SetReferenceLineMapData() - { - ReferenceLine referenceLine = data.Parent.ReferenceLine; - referenceLineMapData.Features = - RingtoetsMapDataFeaturesFactory.CreateReferenceLineFeatures(referenceLine, data.Parent.Id, data.Parent.Name); - } - - #endregion - - #region Sections MapData - - private void UpdateSectionsMapData() - { - SetSectionsMapData(); sectionsMapData.NotifyObservers(); sectionsStartPointMapData.NotifyObservers(); sectionsEndPointMapData.NotifyObservers(); + hydraulicBoundaryLocationsMapData.NotifyObservers(); + foreshoreProfilesMapData.NotifyObservers(); + structuresMapData.NotifyObservers(); + calculationsMapData.NotifyObservers(); } - private void SetSectionsMapData() + private void SetMapDataFeatures() { + ReferenceLine referenceLine = data.Parent.ReferenceLine; IEnumerable failureMechanismSections = data.WrappedData.Sections; + HydraulicBoundaryDatabase hydraulicBoundaryDatabase = data.Parent.HydraulicBoundaryDatabase; + IEnumerable foreshoreProfiles = data.WrappedData.ForeshoreProfiles; + IEnumerable structures = data.WrappedData.ClosingStructures; + IEnumerable> calculations = + data.WrappedData.CalculationsGroup.GetCalculations().Cast>(); + referenceLineMapData.Features = RingtoetsMapDataFeaturesFactory.CreateReferenceLineFeatures(referenceLine, data.Parent.Id, data.Parent.Name); sectionsMapData.Features = RingtoetsMapDataFeaturesFactory.CreateFailureMechanismSectionFeatures(failureMechanismSections); sectionsStartPointMapData.Features = RingtoetsMapDataFeaturesFactory.CreateFailureMechanismSectionStartPointFeatures(failureMechanismSections); sectionsEndPointMapData.Features = RingtoetsMapDataFeaturesFactory.CreateFailureMechanismSectionEndPointFeatures(failureMechanismSections); - } - - #endregion - - #region ForeshoreProfiles MapData - - private void UpdateForeshoreProfilesMapData() - { - SetForeshoreProfilesMapData(); - foreshoreProfilesMapData.NotifyObservers(); - } - - private void SetForeshoreProfilesMapData() - { - IEnumerable foreshoreProfiles = data.WrappedData.ForeshoreProfiles; + hydraulicBoundaryLocationsMapData.Features = RingtoetsMapDataFeaturesFactory.CreateHydraulicBoundaryDatabaseFeatures(hydraulicBoundaryDatabase); foreshoreProfilesMapData.Features = RingtoetsMapDataFeaturesFactory.CreateForeshoreProfilesFeatures(foreshoreProfiles); - } - - #endregion - - #region Structures MapData - - private void UpdateStructuresMapData() - { - SetStructuresMapData(); - structuresMapData.NotifyObservers(); - } - - private void SetStructuresMapData() - { - IEnumerable structures = data.WrappedData.ClosingStructures; structuresMapData.Features = RingtoetsMapDataFeaturesFactory.CreateStructuresFeatures(structures); + calculationsMapData.Features = RingtoetsMapDataFeaturesFactory.CreateStructureCalculationsFeatures(calculations); } - - #endregion } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/DikeProfiles/IHasForeshoreProfile.cs =================================================================== diff -u -r9a63dd4cf6589ffe683d8e1eb3694afced6efc78 -r5ee23018be55ff03a7851e54ca0a6682c521f952 --- Ringtoets/Common/src/Ringtoets.Common.Data/DikeProfiles/IHasForeshoreProfile.cs (.../IHasForeshoreProfile.cs) (revision 9a63dd4cf6589ffe683d8e1eb3694afced6efc78) +++ Ringtoets/Common/src/Ringtoets.Common.Data/DikeProfiles/IHasForeshoreProfile.cs (.../IHasForeshoreProfile.cs) (revision 5ee23018be55ff03a7851e54ca0a6682c521f952) @@ -22,7 +22,7 @@ namespace Ringtoets.Common.Data.DikeProfiles { /// - /// This interface describes if an object has a foreshore profile. + /// Interface for objects which can have a foreshore profile. /// public interface IHasForeshoreProfile { Index: Ringtoets/Common/src/Ringtoets.Common.Data/UpdateDataStrategies/ReplaceDataStrategyBase.cs =================================================================== diff -u -rf041e286343be511163e939762223954d4851a4e -r5ee23018be55ff03a7851e54ca0a6682c521f952 --- Ringtoets/Common/src/Ringtoets.Common.Data/UpdateDataStrategies/ReplaceDataStrategyBase.cs (.../ReplaceDataStrategyBase.cs) (revision f041e286343be511163e939762223954d4851a4e) +++ Ringtoets/Common/src/Ringtoets.Common.Data/UpdateDataStrategies/ReplaceDataStrategyBase.cs (.../ReplaceDataStrategyBase.cs) (revision 5ee23018be55ff03a7851e54ca0a6682c521f952) @@ -55,7 +55,7 @@ } /// - /// Clears all the dependent data of the target items that within the failure mechanism. + /// Clears all the dependent data of the target items that are within the failure mechanism. /// /// A with all the items that are affected within the failure mechanism /// after clearing all the within the target collection. Index: Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/ForeshoreProfilesImporter.cs =================================================================== diff -u -r4eaa942f6a986a04aacee22d1b8e142b0d07f389 -r5ee23018be55ff03a7851e54ca0a6682c521f952 --- Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/ForeshoreProfilesImporter.cs (.../ForeshoreProfilesImporter.cs) (revision 4eaa942f6a986a04aacee22d1b8e142b0d07f389) +++ Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/ForeshoreProfilesImporter.cs (.../ForeshoreProfilesImporter.cs) (revision 5ee23018be55ff03a7851e54ca0a6682c521f952) @@ -47,11 +47,11 @@ /// /// The foreshore profiles to import on. /// The reference line used to check if the - /// objects found in the file are intersecting it. + /// objects found in the file are intersecting it. /// The path to the file to import from. /// The strategy to update the - /// foreshore profiles with the imported data. - /// + /// foreshore profiles with the imported data. + /// The message provider to provide messages during the import. /// Thrown when any parameter is null. public ForeshoreProfilesImporter(ForeshoreProfileCollection importTarget, ReferenceLine referenceLine, Index: Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/IForeshoreProfileUpdateDataStrategy.cs =================================================================== diff -u -rb1acb656284ee0a7db2384e83d2b36f64fa57dc8 -r5ee23018be55ff03a7851e54ca0a6682c521f952 --- Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/IForeshoreProfileUpdateDataStrategy.cs (.../IForeshoreProfileUpdateDataStrategy.cs) (revision b1acb656284ee0a7db2384e83d2b36f64fa57dc8) +++ Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/IForeshoreProfileUpdateDataStrategy.cs (.../IForeshoreProfileUpdateDataStrategy.cs) (revision 5ee23018be55ff03a7851e54ca0a6682c521f952) @@ -40,7 +40,7 @@ /// to be updated. /// The imported foreshore profiles. /// The source path from where the foreshore - /// profiles were imported from. + /// profiles were imported. /// An of updated instances. /// Thrown when any input argument /// is null. Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestCalculationWithForeshoreProfileTest.cs =================================================================== diff -u -r474b2334202ee2bfbe8df476845bd7e2fca01803 -r5ee23018be55ff03a7851e54ca0a6682c521f952 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestCalculationWithForeshoreProfileTest.cs (.../TestCalculationWithForeshoreProfileTest.cs) (revision 474b2334202ee2bfbe8df476845bd7e2fca01803) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestCalculationWithForeshoreProfileTest.cs (.../TestCalculationWithForeshoreProfileTest.cs) (revision 5ee23018be55ff03a7851e54ca0a6682c521f952) @@ -53,7 +53,7 @@ } [Test] - public void CreateCalculationWithOutput_ReturnsExpectedValues() + public void CreateCalculationWithOutput_WithForeshoreProfile_ReturnsExpectedValues() { // Setup var foreshoreProfile = new TestForeshoreProfile(); @@ -69,7 +69,7 @@ } [Test] - public void CreateCalculationWithoutOutput_ReturnsExpectedValues() + public void CreateCalculationWithoutOutput_WithForeshoreProfile_ReturnsExpectedValues() { // Setup var foreshoreProfile = new TestForeshoreProfile(); @@ -85,32 +85,45 @@ } [Test] - public void GivenCalculationWithOutPut_WhenClearOutputCalled_ThenOutputCleared() + public void CreateCalculationWithoutOutput_ForeshoreProfileNull_ReturnsExpectedValues() { - // Given + // Call + TestCalculationWithForeshoreProfile calculation = + TestCalculationWithForeshoreProfile.CreateCalculationWithoutOutput(null); + + // Assert + Assert.IsFalse(calculation.HasOutput); + Assert.IsNull(calculation.InputParameters.ForeshoreProfile); + Assert.IsNull(calculation.Comments); + } + + [Test] + public void ClearOutput_CalculationWithOutput_OutputClear() + { + // Setup var foreshoreProfile = new TestForeshoreProfile(); TestCalculationWithForeshoreProfile calculation = TestCalculationWithForeshoreProfile.CreateCalculationWithOutput(foreshoreProfile); - // When + // Call calculation.ClearOutput(); - // Then + // Assert Assert.IsFalse(calculation.HasOutput); } [Test] - public void GivenCalculationWithoutOutPut_WhenClearOutputCalled_ThenOutputStillClear() + public void ClearOutput_WithoutOutput_OutputClear() { - // Given + // Setup var foreshoreProfile = new TestForeshoreProfile(); TestCalculationWithForeshoreProfile calculation = TestCalculationWithForeshoreProfile.CreateCalculationWithoutOutput(foreshoreProfile); - // When + // Call calculation.ClearOutput(); - // Then + // Assert Assert.IsFalse(calculation.HasOutput); } } Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/DikeProfilesImporterTest.cs =================================================================== diff -u -r4eaa942f6a986a04aacee22d1b8e142b0d07f389 -r5ee23018be55ff03a7851e54ca0a6682c521f952 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/DikeProfilesImporterTest.cs (.../DikeProfilesImporterTest.cs) (revision 4eaa942f6a986a04aacee22d1b8e142b0d07f389) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/DikeProfilesImporterTest.cs (.../DikeProfilesImporterTest.cs) (revision 5ee23018be55ff03a7851e54ca0a6682c521f952) @@ -554,7 +554,8 @@ var importer = new DikeProfilesImporter(new DikeProfileCollection(), referenceLine, filePath, - strategy, messageProvider); + strategy, + messageProvider); var importResult = true; // Call Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/ForeshoreProfileReplaceDataStrategy.cs =================================================================== diff -u -rb1acb656284ee0a7db2384e83d2b36f64fa57dc8 -r5ee23018be55ff03a7851e54ca0a6682c521f952 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/ForeshoreProfileReplaceDataStrategy.cs (.../ForeshoreProfileReplaceDataStrategy.cs) (revision b1acb656284ee0a7db2384e83d2b36f64fa57dc8) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/ForeshoreProfileReplaceDataStrategy.cs (.../ForeshoreProfileReplaceDataStrategy.cs) (revision 5ee23018be55ff03a7851e54ca0a6682c521f952) @@ -36,7 +36,7 @@ { /// /// A - /// to replace foreshore profiles with imported dike profiles. + /// to replace foreshore profiles with imported foreshore profiles. /// public class ForeshoreProfileReplaceDataStrategy : ReplaceDataStrategyBase, IForeshoreProfileUpdateDataStrategy Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Ringtoets.Integration.Plugin.csproj =================================================================== diff -u -r702888aa87bd696750fcf3f5fcf50e2b8acb0390 -r5ee23018be55ff03a7851e54ca0a6682c521f952 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Ringtoets.Integration.Plugin.csproj (.../Ringtoets.Integration.Plugin.csproj) (revision 702888aa87bd696750fcf3f5fcf50e2b8acb0390) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Ringtoets.Integration.Plugin.csproj (.../Ringtoets.Integration.Plugin.csproj) (revision 5ee23018be55ff03a7851e54ca0a6682c521f952) @@ -281,7 +281,6 @@ -