Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/DataImportHelper.cs =================================================================== diff -u -rd6fe8399e8398224cf1bda9259052232d85b85a4 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/DataImportHelper.cs (.../DataImportHelper.cs) (revision d6fe8399e8398224cf1bda9259052232d85b85a4) +++ Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/DataImportHelper.cs (.../DataImportHelper.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -232,7 +232,7 @@ #region MacroStabilityInwards Specific Imports /// - /// Imports the data for the + /// Imports the data for the /// of the given . /// /// The to import on. @@ -245,7 +245,7 @@ "DR6_surfacelines.krp.csv")) { string filePath = Path.Combine(embeddedResourceFileWriter.TargetFolderPath, "DR6_surfacelines.csv"); - var activity = new FileImportActivity(new SurfaceLinesCsvImporter( + var activity = new FileImportActivity(new SurfaceLinesCsvImporter( assessmentSection.MacroStabilityInwards.SurfaceLines, filePath, new ImportMessageProvider(), Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsCalculationScenarioExtensions.cs =================================================================== diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsCalculationScenarioExtensions.cs (.../MacroStabilityInwardsCalculationScenarioExtensions.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsCalculationScenarioExtensions.cs (.../MacroStabilityInwardsCalculationScenarioExtensions.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -41,7 +41,7 @@ /// Thrown when contains no elements. public static bool IsSurfaceLineIntersectionWithReferenceLineInSection(this MacroStabilityInwardsCalculationScenario macroStabilityInwardsCalculationScenario, IEnumerable lineSegments) { - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = macroStabilityInwardsCalculationScenario?.InputParameters.SurfaceLine; + MacroStabilityInwardsSurfaceLine surfaceLine = macroStabilityInwardsCalculationScenario?.InputParameters.SurfaceLine; if (surfaceLine == null) { return false; Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsFailureMechanism.cs =================================================================== diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsFailureMechanism.cs (.../MacroStabilityInwardsFailureMechanism.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsFailureMechanism.cs (.../MacroStabilityInwardsFailureMechanism.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -42,7 +42,7 @@ { MacroStabilityInwardsProbabilityAssessmentInput = new MacroStabilityInwardsProbabilityAssessmentInput(); GeneralInput = new GeneralMacroStabilityInwardsInput(); - SurfaceLines = new RingtoetsMacroStabilityInwardsSurfaceLineCollection(); + SurfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); StochasticSoilModels = new StochasticSoilModelCollection(); CalculationsGroup = new CalculationGroup(RingtoetsCommonDataResources.FailureMechanism_Calculations_DisplayName, false); @@ -60,7 +60,7 @@ /// /// Gets the available surface lines within the scope of the macro stability inwards failure mechanism. /// - public RingtoetsMacroStabilityInwardsSurfaceLineCollection SurfaceLines { get; } + public MacroStabilityInwardsSurfaceLineCollection SurfaceLines { get; } /// /// Gets the available stochastic soil models within the scope of the macro stability inwards failure mechanism. Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsInput.cs =================================================================== diff -u -r5906f61fff270a7526253bea07dfecdf680898ed -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsInput.cs (.../MacroStabilityInwardsInput.cs) (revision 5906f61fff270a7526253bea07dfecdf680898ed) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsInput.cs (.../MacroStabilityInwardsInput.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -61,7 +61,7 @@ /// /// Gets or sets the surface line. /// - public RingtoetsMacroStabilityInwardsSurfaceLine SurfaceLine { get; set; } + public MacroStabilityInwardsSurfaceLine SurfaceLine { get; set; } /// /// Gets or sets the stochastic soil model which is linked to the . Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsSurfaceLineCollection.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsSurfaceLineCollection.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsSurfaceLineCollection.cs (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -0,0 +1,39 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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 Core.Common.Base; +using Ringtoets.MacroStabilityInwards.Data.Properties; +using Ringtoets.MacroStabilityInwards.Primitives; +using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; + +namespace Ringtoets.MacroStabilityInwards.Data +{ + /// + /// Collection to store items. The + /// names of the items are unique within the collection. + /// + public class MacroStabilityInwardsSurfaceLineCollection : ObservableUniqueItemCollectionWithSourcePath + { + public MacroStabilityInwardsSurfaceLineCollection() : base(line => line.Name, + RingtoetsCommonDataResources.SurfaceLineCollection_TypeDescriptor, + Resources.UniqueFeature_Name_FeatureDescription) {} + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/Ringtoets.MacroStabilityInwards.Data.csproj =================================================================== diff -u -rf6f910cf9e6c78af77bbac56f232242553e3f9de -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/Ringtoets.MacroStabilityInwards.Data.csproj (.../Ringtoets.MacroStabilityInwards.Data.csproj) (revision f6f910cf9e6c78af77bbac56f232242553e3f9de) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/Ringtoets.MacroStabilityInwards.Data.csproj (.../Ringtoets.MacroStabilityInwards.Data.csproj) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -56,7 +56,7 @@ Resources.resx - + Fisheye: Tag cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/RingtoetsMacroStabilityInwardsSurfaceLineCollection.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfileUnderSurfaceLineFactory.cs =================================================================== diff -u -r6483bd7c2aef66cc8ae0879ba2b2b261aa0cb32a -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfileUnderSurfaceLineFactory.cs (.../SoilProfileUnderSurfaceLineFactory.cs) (revision 6483bd7c2aef66cc8ae0879ba2b2b261aa0cb32a) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfileUnderSurfaceLineFactory.cs (.../SoilProfileUnderSurfaceLineFactory.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -41,7 +41,7 @@ /// The surface line for which determines the top of the . /// A new containing geometries from the /// under the . - public static SoilProfileUnderSurfaceLine Create(MacroStabilityInwardsSoilProfile1D soilProfile, RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + public static SoilProfileUnderSurfaceLine Create(MacroStabilityInwardsSoilProfile1D soilProfile, MacroStabilityInwardsSurfaceLine surfaceLine) { if (soilProfile == null) { Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/StochasticSoilModelExtensions.cs =================================================================== diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/StochasticSoilModelExtensions.cs (.../StochasticSoilModelExtensions.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/StochasticSoilModelExtensions.cs (.../StochasticSoilModelExtensions.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -41,7 +41,7 @@ /// false otherwise. /// Thrown when any input parameter is null. public static bool IntersectsWithSurfaceLineGeometry(this StochasticSoilModel stochasticSoilModel, - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + MacroStabilityInwardsSurfaceLine surfaceLine) { if (stochasticSoilModel == null) { Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataFactory.cs =================================================================== diff -u -r95118671634e4963f81f7e5620424fe52fb95486 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataFactory.cs (.../MacroStabilityInwardsChartDataFactory.cs) (revision 95118671634e4963f81f7e5620424fe52fb95486) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataFactory.cs (.../MacroStabilityInwardsChartDataFactory.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -161,9 +161,9 @@ /// Updates the name of based on . /// /// The to update the name for. - /// The used for obtaining the name. + /// The used for obtaining the name. /// A default name is set when is null. - public static void UpdateSurfaceLineChartDataName(ChartLineData chartData, RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + public static void UpdateSurfaceLineChartDataName(ChartLineData chartData, MacroStabilityInwardsSurfaceLine surfaceLine) { chartData.Name = surfaceLine != null ? surfaceLine.Name Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataPointsFactory.cs =================================================================== diff -u -r6483bd7c2aef66cc8ae0879ba2b2b261aa0cb32a -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataPointsFactory.cs (.../MacroStabilityInwardsChartDataPointsFactory.cs) (revision 6483bd7c2aef66cc8ae0879ba2b2b261aa0cb32a) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataPointsFactory.cs (.../MacroStabilityInwardsChartDataPointsFactory.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -38,9 +38,9 @@ /// /// Create surface line points in 2D space based on the provided . /// - /// The to create the surface line points for. + /// The to create the surface line points for. /// An array of points in 2D space or an empty array when is null. - public static Point2D[] CreateSurfaceLinePoints(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + public static Point2D[] CreateSurfaceLinePoints(MacroStabilityInwardsSurfaceLine surfaceLine) { return surfaceLine?.LocalGeometry.ToArray() ?? new Point2D[0]; } @@ -50,7 +50,7 @@ /// /// The to create the soil layer points for. /// The that contains . - /// The that may intersect with + /// The that may intersect with /// the and by doing that restricts the drawn height of it. /// A collection which contains one or more (in the case of /// splitting the layer in multiple parts) arrays of points in 2D space or an empty array when: @@ -63,7 +63,7 @@ /// public static IEnumerable CreateSoilLayerAreas(MacroStabilityInwardsSoilLayer1D soilLayer, MacroStabilityInwardsSoilProfile1D soilProfile, - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + MacroStabilityInwardsSurfaceLine surfaceLine) { if (soilLayer == null || soilProfile == null || surfaceLine == null) { @@ -98,7 +98,7 @@ /// the surface level outside point in is null. /// /// - public static Point2D[] CreateSurfaceLevelOutsidePoint(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + public static Point2D[] CreateSurfaceLevelOutsidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.SurfaceLevelOutside); } @@ -113,7 +113,7 @@ /// the dike toe at river point in is null. /// /// - public static Point2D[] CreateDikeToeAtRiverPoint(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + public static Point2D[] CreateDikeToeAtRiverPoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.DikeToeAtRiver); } @@ -128,7 +128,7 @@ /// the traffic load outside point in is null. /// /// - public static Point2D[] CreateTrafficLoadOutsidePoint(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + public static Point2D[] CreateTrafficLoadOutsidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.TrafficLoadOutside); } @@ -143,7 +143,7 @@ /// the traffic load inside point in is null. /// /// - public static Point2D[] CreateTrafficLoadInsidePoint(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + public static Point2D[] CreateTrafficLoadInsidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.TrafficLoadInside); } @@ -158,7 +158,7 @@ /// the dike top at polder point in is null. /// /// - public static Point2D[] CreateDikeTopAtPolderPoint(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + public static Point2D[] CreateDikeTopAtPolderPoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.DikeTopAtPolder); } @@ -173,7 +173,7 @@ /// the shoulder base inside point in is null. /// /// - public static Point2D[] CreateShoulderBaseInsidePoint(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + public static Point2D[] CreateShoulderBaseInsidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.ShoulderBaseInside); } @@ -188,7 +188,7 @@ /// the shoulder top inside point in is null. /// /// - public static Point2D[] CreateShoulderTopInsidePoint(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + public static Point2D[] CreateShoulderTopInsidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.ShoulderTopInside); } @@ -203,7 +203,7 @@ /// the dike toe at polder point in is null. /// /// - public static Point2D[] CreateDikeToeAtPolderPoint(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + public static Point2D[] CreateDikeToeAtPolderPoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.DikeToeAtPolder); } @@ -218,7 +218,7 @@ /// the ditch dike side point in is null. /// /// - public static Point2D[] CreateDitchDikeSidePoint(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + public static Point2D[] CreateDitchDikeSidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.DitchDikeSide); } @@ -233,7 +233,7 @@ /// the bottom ditch dike side point in is null. /// /// - public static Point2D[] CreateBottomDitchDikeSidePoint(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + public static Point2D[] CreateBottomDitchDikeSidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.BottomDitchDikeSide); } @@ -248,7 +248,7 @@ /// the bottom ditch polder side point in is null. /// /// - public static Point2D[] CreateBottomDitchPolderSidePoint(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + public static Point2D[] CreateBottomDitchPolderSidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.BottomDitchPolderSide); } @@ -263,7 +263,7 @@ /// the surface level inside point in is null. /// /// - public static Point2D[] CreateSurfaceLevelInsidePoint(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + public static Point2D[] CreateSurfaceLevelInsidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.SurfaceLevelInside); } @@ -278,12 +278,12 @@ /// the ditch polder side point in is null. /// /// - public static Point2D[] CreateDitchPolderSidePoint(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + public static Point2D[] CreateDitchPolderSidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.DitchPolderSide); } - private static Point2D[] GetLocalPointsFromGeometry(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, + private static Point2D[] GetLocalPointsFromGeometry(MacroStabilityInwardsSurfaceLine surfaceLine, Point3D worldCoordinate) { if (surfaceLine == null || worldCoordinate == null) Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsMapDataFactory.cs =================================================================== diff -u -r9540d67453c6a1caf5833d64ab651660dce11595 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsMapDataFactory.cs (.../MacroStabilityInwardsMapDataFactory.cs) (revision 9540d67453c6a1caf5833d64ab651660dce11595) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsMapDataFactory.cs (.../MacroStabilityInwardsMapDataFactory.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -36,7 +36,7 @@ internal static class MacroStabilityInwardsMapDataFactory { /// - /// Create with default styling for collections of . + /// Create with default styling for collections of . /// /// The created . public static MapLineData CreateSurfaceLinesMapData() Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsMapDataFeaturesFactory.cs =================================================================== diff -u -r5906f61fff270a7526253bea07dfecdf680898ed -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsMapDataFeaturesFactory.cs (.../MacroStabilityInwardsMapDataFeaturesFactory.cs) (revision 5906f61fff270a7526253bea07dfecdf680898ed) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsMapDataFeaturesFactory.cs (.../MacroStabilityInwardsMapDataFeaturesFactory.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -41,17 +41,17 @@ /// /// Create surface line features based on the provided . /// - /// The collection of to create the surface line features for. + /// The collection of to create the surface line features for. /// An array of features or an empty array when is null or empty. - public static MapFeature[] CreateSurfaceLineFeatures(RingtoetsMacroStabilityInwardsSurfaceLine[] surfaceLines) + public static MapFeature[] CreateSurfaceLineFeatures(MacroStabilityInwardsSurfaceLine[] surfaceLines) { if (surfaceLines != null && surfaceLines.Any()) { var features = new MapFeature[surfaceLines.Length]; for (var i = 0; i < surfaceLines.Length; i++) { - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = surfaceLines[i]; + MacroStabilityInwardsSurfaceLine surfaceLine = surfaceLines[i]; MapFeature feature = RingtoetsMapDataFeaturesFactory.CreateSingleLineMapFeature(GetWorldPoints(surfaceLine)); feature.MetaData[RingtoetsCommonFormsResources.MetaData_Name] = surfaceLine.Name; @@ -121,7 +121,7 @@ return RingtoetsMapDataFeaturesFactory.CreateCalculationFeatures(calculationData); } - private static IEnumerable GetWorldPoints(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + private static IEnumerable GetWorldPoints(MacroStabilityInwardsSurfaceLine surfaceLine) { return surfaceLine.Points.Select(p => new Point2D(p.X, p.Y)); } Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/MacroStabilityInwardsCalculationConfigurationHelper.cs =================================================================== diff -u -r5906f61fff270a7526253bea07dfecdf680898ed -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/MacroStabilityInwardsCalculationConfigurationHelper.cs (.../MacroStabilityInwardsCalculationConfigurationHelper.cs) (revision 5906f61fff270a7526253bea07dfecdf680898ed) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/MacroStabilityInwardsCalculationConfigurationHelper.cs (.../MacroStabilityInwardsCalculationConfigurationHelper.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -55,7 +55,7 @@ /// is null /// is null /// - public static IEnumerable GenerateCalculationItemsStructure(IEnumerable surfaceLines, IEnumerable soilModels, GeneralMacroStabilityInwardsInput generalInput) + public static IEnumerable GenerateCalculationItemsStructure(IEnumerable surfaceLines, IEnumerable soilModels, GeneralMacroStabilityInwardsInput generalInput) { if (surfaceLines == null) { @@ -71,7 +71,7 @@ } var groups = new List(); - foreach (RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine in surfaceLines) + foreach (MacroStabilityInwardsSurfaceLine surfaceLine in surfaceLines) { CalculationGroup group = CreateCalculationGroup(surfaceLine, soilModels, generalInput); if (group.GetCalculations().Any()) @@ -81,7 +81,7 @@ else { log.WarnFormat( - Resources.MacroStabilityInwardsCalculationConfigurationHelper_GenerateCalculationsStructure_No_SoilProfile_found_for_RingtoetsMacroStabilityInwardsSurfaceLine_0_skipped, + Resources.MacroStabilityInwardsCalculationConfigurationHelper_GenerateCalculationsStructure_No_SoilProfile_found_for_MacroStabilityInwardsSurfaceLine_0_skipped, surfaceLine.Name); } } @@ -96,7 +96,7 @@ /// The (sub)set of stochastic soil models from /// or empty if no matching instances can be found /// or when there is not enough information to associate soil profiles to the calculation. - public static IEnumerable GetStochasticSoilModelsForSurfaceLine(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, IEnumerable availableSoilModels) + public static IEnumerable GetStochasticSoilModelsForSurfaceLine(MacroStabilityInwardsSurfaceLine surfaceLine, IEnumerable availableSoilModels) { if (surfaceLine == null) { @@ -108,7 +108,7 @@ .ToList(); } - private static CalculationGroup CreateCalculationGroup(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, IEnumerable soilModels, GeneralMacroStabilityInwardsInput generalInput) + private static CalculationGroup CreateCalculationGroup(MacroStabilityInwardsSurfaceLine surfaceLine, IEnumerable soilModels, GeneralMacroStabilityInwardsInput generalInput) { var calculationGroup = new CalculationGroup(surfaceLine.Name, true); IEnumerable stochasticSoilModels = GetStochasticSoilModelsForSurfaceLine(surfaceLine, soilModels); @@ -123,7 +123,7 @@ return calculationGroup; } - private static ICalculationBase CreateMacroStabilityInwardsCalculation(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, StochasticSoilModel stochasticSoilModel, StochasticSoilProfile stochasticSoilProfile, IEnumerable calculations, GeneralMacroStabilityInwardsInput generalInput) + private static ICalculationBase CreateMacroStabilityInwardsCalculation(MacroStabilityInwardsSurfaceLine surfaceLine, StochasticSoilModel stochasticSoilModel, StochasticSoilProfile stochasticSoilProfile, IEnumerable calculations, GeneralMacroStabilityInwardsInput generalInput) { string nameBase = $"{surfaceLine.Name} {stochasticSoilProfile}"; string name = NamingHelper.GetUniqueName(calculations, nameBase, c => c.Name); Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/MacroStabilityInwardsSurfaceLineSelectionDialog.cs =================================================================== diff -u -r2fc082ea75494a149eca240146035aa8fa7f9e1c -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/MacroStabilityInwardsSurfaceLineSelectionDialog.cs (.../MacroStabilityInwardsSurfaceLineSelectionDialog.cs) (revision 2fc082ea75494a149eca240146035aa8fa7f9e1c) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/MacroStabilityInwardsSurfaceLineSelectionDialog.cs (.../MacroStabilityInwardsSurfaceLineSelectionDialog.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -32,18 +32,18 @@ namespace Ringtoets.MacroStabilityInwards.Forms { /// - /// A dialog which allows the user to make a selection from a given set of . Upon - /// closing of the dialog, the selected can be obtained. + /// A dialog which allows the user to make a selection from a given set of . Upon + /// closing of the dialog, the selected can be obtained. /// - public class MacroStabilityInwardsSurfaceLineSelectionDialog : SelectionDialogBase + public class MacroStabilityInwardsSurfaceLineSelectionDialog : SelectionDialogBase { /// /// Creates a new instance of . /// /// The parent of the dialog. - /// The collection of to show in the dialog. + /// The collection of to show in the dialog. /// Thrown when any parameter is null. - public MacroStabilityInwardsSurfaceLineSelectionDialog(IWin32Window dialogParent, IEnumerable surfaceLines) + public MacroStabilityInwardsSurfaceLineSelectionDialog(IWin32Window dialogParent, IEnumerable surfaceLines) : base(dialogParent) { if (surfaceLines == null) @@ -54,7 +54,7 @@ Text = Resources.MacroStabilityInwardsSurfaceLineSelectionDialog_Select_SurfaceLines; InitializeDataGridView(RingtoetsCommonFormsResources.SurfaceLine_DisplayName); - SetDataSource(surfaceLines.Select(sl => new SelectableRow(sl, sl.Name)).ToArray()); + SetDataSource(surfaceLines.Select(sl => new SelectableRow(sl, sl.Name)).ToArray()); } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsCalculationGroupContext.cs =================================================================== diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsCalculationGroupContext.cs (.../MacroStabilityInwardsCalculationGroupContext.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsCalculationGroupContext.cs (.../MacroStabilityInwardsCalculationGroupContext.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -46,7 +46,7 @@ /// The assessment section which the context belongs to. /// Thrown when any input argument is null. public MacroStabilityInwardsCalculationGroupContext(CalculationGroup calculationGroup, - IEnumerable surfaceLines, + IEnumerable surfaceLines, IEnumerable stochasticSoilModels, MacroStabilityInwardsFailureMechanism macroStabilityInwardsFailureMechanism, IAssessmentSection assessmentSection) Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsCalculationScenarioContext.cs =================================================================== diff -u -r5906f61fff270a7526253bea07dfecdf680898ed -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsCalculationScenarioContext.cs (.../MacroStabilityInwardsCalculationScenarioContext.cs) (revision 5906f61fff270a7526253bea07dfecdf680898ed) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsCalculationScenarioContext.cs (.../MacroStabilityInwardsCalculationScenarioContext.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -44,7 +44,7 @@ /// The assessment section which the macro stability inwards context belongs to. /// Thrown when any input argument is null. public MacroStabilityInwardsCalculationScenarioContext(MacroStabilityInwardsCalculationScenario calculation, - IEnumerable surfaceLines, + IEnumerable surfaceLines, IEnumerable stochasticSoilModels, MacroStabilityInwardsFailureMechanism macroStabilityInwardsFailureMechanism, IAssessmentSection assessmentSection) Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsContext.cs =================================================================== diff -u -r5906f61fff270a7526253bea07dfecdf680898ed -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsContext.cs (.../MacroStabilityInwardsContext.cs) (revision 5906f61fff270a7526253bea07dfecdf680898ed) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsContext.cs (.../MacroStabilityInwardsContext.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -48,7 +48,7 @@ /// Thrown when any input argument is null. protected MacroStabilityInwardsContext( T wrappedData, - IEnumerable surfaceLines, + IEnumerable surfaceLines, IEnumerable stochasticSoilModels, MacroStabilityInwardsFailureMechanism macroStabilityInwardsFailureMechanism, IAssessmentSection assessmentSection) : base(wrappedData) @@ -65,7 +65,7 @@ /// Gets the available macro stability inwards surface lines in order for the user to select one to /// set . /// - public IEnumerable AvailableMacroStabilityInwardsSurfaceLines { get; private set; } + public IEnumerable AvailableMacroStabilityInwardsSurfaceLines { get; private set; } /// /// Gets the available stochastic soil models in order for the user to select a and @@ -107,7 +107,7 @@ /// The macro stability inwards failure mechanism. /// The assessment section. /// Thrown when any input parameter is null. - private static void AssertInputsAreNotNull(IEnumerable surfaceLines, + private static void AssertInputsAreNotNull(IEnumerable surfaceLines, IEnumerable stochasticSoilModels, MacroStabilityInwardsFailureMechanism macroStabilityInwardsFailureMechanism, IAssessmentSection assessmentSection) Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsInputContext.cs =================================================================== diff -u -rcfe30fb624bcc031454e7ff22e333386ed6ead87 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsInputContext.cs (.../MacroStabilityInwardsInputContext.cs) (revision cfe30fb624bcc031454e7ff22e333386ed6ead87) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsInputContext.cs (.../MacroStabilityInwardsInputContext.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -46,7 +46,7 @@ /// Thrown when any input argument is null. public MacroStabilityInwardsInputContext(MacroStabilityInwardsInput macroStabilityInwardsInput, MacroStabilityInwardsCalculationScenario calculation, - IEnumerable surfaceLines, + IEnumerable surfaceLines, IEnumerable stochasticSoilModels, MacroStabilityInwardsFailureMechanism macroStabilityInwardsFailureMechanism, IAssessmentSection assessmentSection) Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsSurfaceLinesContext.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsSurfaceLinesContext.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsSurfaceLinesContext.cs (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -0,0 +1,69 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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 Core.Common.Controls.PresentationObjects; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.MacroStabilityInwards.Data; + +namespace Ringtoets.MacroStabilityInwards.Forms.PresentationObjects +{ + /// + /// The presentation object for . + /// + public class MacroStabilityInwardsSurfaceLinesContext : ObservableWrappedObjectContextBase + { + /// + /// Creates a new instance of . + /// + /// The collection to update. + /// The failure mechanism. + /// The assessment section. + /// Thrown when any input argument is null. + public MacroStabilityInwardsSurfaceLinesContext(MacroStabilityInwardsSurfaceLineCollection surfaceLines, + MacroStabilityInwardsFailureMechanism failureMechanism, + IAssessmentSection assessmentSection) + : base(surfaceLines) + { + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + AssessmentSection = assessmentSection; + FailureMechanism = failureMechanism; + } + + /// + /// Gets the assessment section which the context belongs to. + /// + public IAssessmentSection AssessmentSection { get; private set; } + + /// + /// Gets the failure mechanism which the context belongs to. + /// + public MacroStabilityInwardsFailureMechanism FailureMechanism { get; private set; } + } +} \ No newline at end of file Fisheye: Tag cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/RingtoetsMacroStabilityInwardsSurfaceLinesContext.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r42589a013431937bdf0165af5fda1228d235629a -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 42589a013431937bdf0165af5fda1228d235629a) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -138,10 +138,10 @@ /// /// Looks up a localized string similar to Geen ondergrondschematisaties gevonden voor profielschematisatie '{0}'. De profielschematisatie is overgeslagen.. /// - public static string MacroStabilityInwardsCalculationConfigurationHelper_GenerateCalculationsStructure_No_SoilProfile_found_for_RingtoetsMacroStabilityInwardsSurfaceLine_0_skipped { + public static string MacroStabilityInwardsCalculationConfigurationHelper_GenerateCalculationsStructure_No_SoilProfile_found_for_MacroStabilityInwardsSurfaceLine_0_skipped { get { return ResourceManager.GetString("MacroStabilityInwardsCalculationConfigurationHelper_GenerateCalculationsStructure" + - "_No_SoilProfile_found_for_RingtoetsMacroStabilityInwardsSurfaceLine_0_skipped", resourceCulture); + "_No_SoilProfile_found_for_MacroStabilityInwardsSurfaceLine_0_skipped", resourceCulture); } } @@ -423,20 +423,20 @@ } /// - /// Looks up a localized string similar to Selecteer profielschematisaties. + /// Looks up a localized string similar to De locatie van het bestand waaruit de profielschematisaties zijn geïmporteerd.. /// - public static string MacroStabilityInwardsSurfaceLineSelectionDialog_Select_SurfaceLines { + public static string MacroStabilityInwardsSurfaceLineCollection_SourcePath_Description { get { - return ResourceManager.GetString("MacroStabilityInwardsSurfaceLineSelectionDialog_Select_SurfaceLines", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSurfaceLineCollection_SourcePath_Description", resourceCulture); } } /// - /// Looks up a localized string similar to De locatie van het bestand waaruit de profielschematisaties zijn geïmporteerd.. + /// Looks up a localized string similar to Selecteer profielschematisaties. /// - public static string RingtoetsMacroStabilityInwardsSurfaceLineCollection_SourcePath_Description { + public static string MacroStabilityInwardsSurfaceLineSelectionDialog_Select_SurfaceLines { get { - return ResourceManager.GetString("RingtoetsMacroStabilityInwardsSurfaceLineCollection_SourcePath_Description", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSurfaceLineSelectionDialog_Select_SurfaceLines", resourceCulture); } } Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.resx =================================================================== diff -u -r42589a013431937bdf0165af5fda1228d235629a -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision 42589a013431937bdf0165af5fda1228d235629a) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -253,7 +253,7 @@ De verschillende opbouwen van de ondergrond en hun respectieve kansen van voorkomen. - + Geen ondergrondschematisaties gevonden voor profielschematisatie '{0}'. De profielschematisatie is overgeslagen. @@ -292,7 +292,7 @@ Is aquifer - + De locatie van het bestand waaruit de profielschematisaties zijn geïmporteerd. \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsInputContextProperties.cs =================================================================== diff -u -rb04ee63f77708d3e30dd18f07dbb8ab31d548edb -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsInputContextProperties.cs (.../MacroStabilityInwardsInputContextProperties.cs) (revision b04ee63f77708d3e30dd18f07dbb8ab31d548edb) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsInputContextProperties.cs (.../MacroStabilityInwardsInputContextProperties.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -83,7 +83,7 @@ /// /// Gets the available surface lines on . /// - public IEnumerable GetAvailableSurfaceLines() + public IEnumerable GetAvailableSurfaceLines() { return data.AvailableMacroStabilityInwardsSurfaceLines; } @@ -207,7 +207,7 @@ [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Schematization))] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.SurfaceLine_DisplayName))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.SurfaceLine_Description))] - public RingtoetsMacroStabilityInwardsSurfaceLine SurfaceLine + public MacroStabilityInwardsSurfaceLine SurfaceLine { get { Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsSurfaceLineCollectionProperties.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsSurfaceLineCollectionProperties.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsSurfaceLineCollectionProperties.cs (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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 Core.Common.Gui.PropertyBag; +using Core.Common.Utils.Attributes; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.MacroStabilityInwards.Forms.Properties; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.MacroStabilityInwards.Forms.PropertyClasses +{ + /// + /// ViewModel of for properties panel. + /// + public class MacroStabilityInwardsSurfaceLineCollectionProperties : ObjectProperties + { + /// + /// Creates a new instance of . + /// + /// The collection for which the properties are shown. + /// Thrown when + /// is null. + public MacroStabilityInwardsSurfaceLineCollectionProperties(MacroStabilityInwardsSurfaceLineCollection collection) + { + if (collection == null) + { + throw new ArgumentNullException(nameof(collection)); + } + data = collection; + } + + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ObservableCollectionWithSourcePath_SourcePath_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.MacroStabilityInwardsSurfaceLineCollection_SourcePath_Description))] + public string SourcePath + { + get + { + return data.SourcePath; + } + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsSurfaceLineProperties.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsSurfaceLineProperties.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsSurfaceLineProperties.cs (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -0,0 +1,207 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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.Linq; +using Core.Common.Base.Geometry; +using Core.Common.Gui.Converters; +using Core.Common.Gui.PropertyBag; +using Core.Common.Utils.Attributes; +using Ringtoets.MacroStabilityInwards.Forms.Properties; +using Ringtoets.MacroStabilityInwards.Primitives; +using TypeConverter = System.ComponentModel.TypeConverterAttribute; +using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.MacroStabilityInwards.Forms.PropertyClasses +{ + /// + /// ViewModel of for properties panel. + /// + [ResourcesDisplayName(typeof(Resources), nameof(RingtoetsCommonFormsResources.SurfaceLine_DisplayName))] + public class MacroStabilityInwardsSurfaceLineProperties : ObjectProperties + { + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.SurfaceLine_Name_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.SurfaceLine_Name_Description))] + public string Name + { + get + { + return data.Name; + } + } + + [TypeConverter(typeof(ExpandableArrayConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.SurfaceLine_Points_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.SurfaceLine_Points_Description))] + public Point3D[] Points + { + get + { + return data.Points.ToArray(); + } + } + + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Characteristic_points))] + [ResourcesDisplayName(typeof(RingtoetsCommonDataResources), nameof(RingtoetsCommonDataResources.CharacteristicPoint_SurfaceLevelOutside))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CharacteristicPoint_SurfaceLevelOutside_Description))] + public Point3D SurfaceLevelOutside + { + get + { + return data.SurfaceLevelOutside; + } + } + + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Characteristic_points))] + [ResourcesDisplayName(typeof(RingtoetsCommonDataResources), nameof(RingtoetsCommonDataResources.CharacteristicPoint_DikeToeAtRiver))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CharacteristicPoint_DikeToeAtRiver_Description))] + public Point3D DikeToeAtRiver + { + get + { + return data.DikeToeAtRiver; + } + } + + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Characteristic_points))] + [ResourcesDisplayName(typeof(RingtoetsCommonDataResources), nameof(RingtoetsCommonDataResources.CharacteristicPoint_TrafficLoadOutside))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CharacteristicPoint_TrafficLoadOutside_Description))] + public Point3D TrafficLoadOutside + { + get + { + return data.TrafficLoadOutside; + } + } + + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Characteristic_points))] + [ResourcesDisplayName(typeof(RingtoetsCommonDataResources), nameof(RingtoetsCommonDataResources.CharacteristicPoint_TrafficLoadInside))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CharacteristicPoint_TrafficLoadInside_Description))] + public Point3D TrafficLoadInside + { + get + { + return data.TrafficLoadInside; + } + } + + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Characteristic_points))] + [ResourcesDisplayName(typeof(RingtoetsCommonDataResources), nameof(RingtoetsCommonDataResources.CharacteristicPoint_DikeTopAtPolder))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CharacteristicPoint_DikeTopAtPolder_Description))] + public Point3D DikeTopAtPolder + { + get + { + return data.DikeTopAtPolder; + } + } + + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Characteristic_points))] + [ResourcesDisplayName(typeof(RingtoetsCommonDataResources), nameof(RingtoetsCommonDataResources.CharacteristicPoint_ShoulderBaseInside))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CharacteristicPoint_ShoulderBaseInside_Description))] + public Point3D ShoulderBaseInside + { + get + { + return data.ShoulderBaseInside; + } + } + + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Characteristic_points))] + [ResourcesDisplayName(typeof(RingtoetsCommonDataResources), nameof(RingtoetsCommonDataResources.CharacteristicPoint_ShoulderTopInside))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CharacteristicPoint_ShoulderTopInside_Description))] + public Point3D ShoulderTopInside + { + get + { + return data.ShoulderTopInside; + } + } + + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Characteristic_points))] + [ResourcesDisplayName(typeof(RingtoetsCommonDataResources), nameof(RingtoetsCommonDataResources.CharacteristicPoint_DikeToeAtPolder))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CharacteristicPoint_DikeToeAtPolder_Description))] + public Point3D DikeToeAtPolder + { + get + { + return data.DikeToeAtPolder; + } + } + + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Characteristic_points))] + [ResourcesDisplayName(typeof(RingtoetsCommonDataResources), nameof(RingtoetsCommonDataResources.CharacteristicPoint_DitchDikeSide))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CharacteristicPoint_DitchDikeSide_Description))] + public Point3D DitchDikeSide + { + get + { + return data.DitchDikeSide; + } + } + + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Characteristic_points))] + [ResourcesDisplayName(typeof(RingtoetsCommonDataResources), nameof(RingtoetsCommonDataResources.CharacteristicPoint_BottomDitchDikeSide))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CharacteristicPoint_BottomDitchDikeSide_Description))] + public Point3D BottomDitchDikeSide + { + get + { + return data.BottomDitchDikeSide; + } + } + + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Characteristic_points))] + [ResourcesDisplayName(typeof(RingtoetsCommonDataResources), nameof(RingtoetsCommonDataResources.CharacteristicPoint_BottomDitchPolderSide))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CharacteristicPoint_BottomDitchPolderSide_Description))] + public Point3D BottomDitchPolderSide + { + get + { + return data.BottomDitchPolderSide; + } + } + + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Characteristic_points))] + [ResourcesDisplayName(typeof(RingtoetsCommonDataResources), nameof(RingtoetsCommonDataResources.CharacteristicPoint_DitchPolderSide))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CharacteristicPoint_DitchPolderSide_Description))] + public Point3D DitchPolderSide + { + get + { + return data.DitchPolderSide; + } + } + + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Characteristic_points))] + [ResourcesDisplayName(typeof(RingtoetsCommonDataResources), nameof(RingtoetsCommonDataResources.CharacteristicPoint_SurfaceLevelInside))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CharacteristicPoint_SurfaceLevelInside_Description))] + public Point3D SurfaceLevelInside + { + get + { + return data.SurfaceLevelInside; + } + } + } +} \ No newline at end of file Fisheye: Tag cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PropertyClasses/RingtoetsMacroStabilityInwardsSurfaceLineCollectionProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PropertyClasses/RingtoetsMacroStabilityInwardsSurfaceLineProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Ringtoets.MacroStabilityInwards.Forms.csproj =================================================================== diff -u -r015737b4977d3a180f8a962ceeb24e6814227316 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Ringtoets.MacroStabilityInwards.Forms.csproj (.../Ringtoets.MacroStabilityInwards.Forms.csproj) (revision 015737b4977d3a180f8a962ceeb24e6814227316) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Ringtoets.MacroStabilityInwards.Forms.csproj (.../Ringtoets.MacroStabilityInwards.Forms.csproj) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -57,7 +57,7 @@ - + @@ -68,10 +68,10 @@ - + - + Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/UITypeEditors/MacroStabilityInwardsInputContextSurfaceLineSelectionEditor.cs =================================================================== diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/UITypeEditors/MacroStabilityInwardsInputContextSurfaceLineSelectionEditor.cs (.../MacroStabilityInwardsInputContextSurfaceLineSelectionEditor.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/UITypeEditors/MacroStabilityInwardsInputContextSurfaceLineSelectionEditor.cs (.../MacroStabilityInwardsInputContextSurfaceLineSelectionEditor.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -29,24 +29,24 @@ { /// /// This class defines a drop down list edit-control from which the user can select a - /// from a collection. + /// from a collection. /// - public class MacroStabilityInwardsInputContextSurfaceLineSelectionEditor : SelectionEditor + public class MacroStabilityInwardsInputContextSurfaceLineSelectionEditor : SelectionEditor { /// /// Creates a new instance of . /// public MacroStabilityInwardsInputContextSurfaceLineSelectionEditor() { - DisplayMember = nameof(RingtoetsMacroStabilityInwardsSurfaceLine.Name); + DisplayMember = nameof(MacroStabilityInwardsSurfaceLine.Name); } - protected override IEnumerable GetAvailableOptions(ITypeDescriptorContext context) + protected override IEnumerable GetAvailableOptions(ITypeDescriptorContext context) { return GetPropertiesObject(context).GetAvailableSurfaceLines(); } - protected override RingtoetsMacroStabilityInwardsSurfaceLine GetCurrentOption(ITypeDescriptorContext context) + protected override MacroStabilityInwardsSurfaceLine GetCurrentOption(ITypeDescriptorContext context) { return GetPropertiesObject(context).SurfaceLine; } Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsCalculationsView.cs =================================================================== diff -u -r67e77262b9f0f183db81f8c95d7b12aa5fcdb8e9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsCalculationsView.cs (.../MacroStabilityInwardsCalculationsView.cs) (revision 67e77262b9f0f183db81f8c95d7b12aa5fcdb8e9) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsCalculationsView.cs (.../MacroStabilityInwardsCalculationsView.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -56,7 +56,7 @@ private readonly RecursiveObserver calculationGroupObserver; private readonly RecursiveObserver calculationObserver; private readonly Observer failureMechanismObserver; - private readonly RecursiveObserver surfaceLineObserver; + private readonly RecursiveObserver surfaceLineObserver; private readonly Observer stochasticSoilModelsObserver; private readonly RecursiveObserver stochasticSoilProfileObserver; private IAssessmentSection assessmentSection; @@ -81,7 +81,7 @@ calculationGroupObserver = new RecursiveObserver(UpdateDataGridViewDataSource, cg => cg.Children); calculationObserver = new RecursiveObserver(dataGridViewControl.RefreshDataGridView, cg => cg.Children); - surfaceLineObserver = new RecursiveObserver(UpdateDataGridViewDataSource, rpslc => rpslc); + surfaceLineObserver = new RecursiveObserver(UpdateDataGridViewDataSource, rpslc => rpslc); stochasticSoilModelsObserver = new Observer(OnStochasticSoilModelsUpdate); stochasticSoilProfileObserver = new RecursiveObserver(dataGridViewControl.RefreshDataGridView, ssmc => ssmc.SelectMany(ssm => ssm.StochasticSoilProfiles)); @@ -273,7 +273,7 @@ } private static IEnumerable GetSelectableHydraulicBoundaryLocations( - IEnumerable hydraulicBoundaryLocations, RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + IEnumerable hydraulicBoundaryLocations, MacroStabilityInwardsSurfaceLine surfaceLine) { Point2D referencePoint = surfaceLine?.ReferenceLineIntersectionWorldPoint; return SelectableHydraulicBoundaryLocationHelper.GetSortedSelectableHydraulicBoundaryLocations( @@ -536,7 +536,7 @@ return selectableHydraulicBoundaryLocations; } - foreach (RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine in MacroStabilityInwardsFailureMechanism.SurfaceLines) + foreach (MacroStabilityInwardsSurfaceLine surfaceLine in MacroStabilityInwardsFailureMechanism.SurfaceLines) { selectableHydraulicBoundaryLocations.AddRange(GetSelectableHydraulicBoundaryLocations(hydraulicBoundaryLocations, surfaceLine)); } Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFailureMechanismView.cs =================================================================== diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFailureMechanismView.cs (.../MacroStabilityInwardsFailureMechanismView.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFailureMechanismView.cs (.../MacroStabilityInwardsFailureMechanismView.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -52,7 +52,7 @@ private readonly RecursiveObserver calculationInputObserver; private readonly RecursiveObserver calculationGroupObserver; private readonly RecursiveObserver calculationObserver; - private readonly RecursiveObserver surfaceLineObserver; + private readonly RecursiveObserver surfaceLineObserver; private readonly MapDataCollection mapDataCollection; private readonly MapLineData referenceLineMapData; @@ -91,7 +91,7 @@ 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); - surfaceLineObserver = new RecursiveObserver(UpdateSurfaceLinesMapData, rpslc => rpslc); + surfaceLineObserver = new RecursiveObserver(UpdateSurfaceLinesMapData, rpslc => rpslc); mapDataCollection = new MapDataCollection(MacroStabilityInwardsDataResources.MacroStabilityInwardsFailureMechanism_DisplayName); referenceLineMapData = RingtoetsMapDataFactory.CreateReferenceLineMapData(); @@ -285,8 +285,8 @@ private void SetSurfaceLinesMapData() { - RingtoetsMacroStabilityInwardsSurfaceLineCollection ringtoetsMacroStabilityInwardsSurfaceLines = data.WrappedData.SurfaceLines; - surfaceLinesMapData.Features = MacroStabilityInwardsMapDataFeaturesFactory.CreateSurfaceLineFeatures(ringtoetsMacroStabilityInwardsSurfaceLines.ToArray()); + MacroStabilityInwardsSurfaceLineCollection macroStabilityInwardsSurfaceLines = data.WrappedData.SurfaceLines; + surfaceLinesMapData.Features = MacroStabilityInwardsMapDataFeaturesFactory.CreateSurfaceLineFeatures(macroStabilityInwardsSurfaceLines.ToArray()); } #endregion Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsInputView.cs =================================================================== diff -u -rd47809e3a8fadff2be5b10056b79b16dc27eeca2 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsInputView.cs (.../MacroStabilityInwardsInputView.cs) (revision d47809e3a8fadff2be5b10056b79b16dc27eeca2) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsInputView.cs (.../MacroStabilityInwardsInputView.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -186,7 +186,7 @@ private void SetChartData() { - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = data.InputParameters.SurfaceLine; + MacroStabilityInwardsSurfaceLine surfaceLine = data.InputParameters.SurfaceLine; MacroStabilityInwardsChartDataFactory.UpdateSurfaceLineChartDataName(surfaceLineChartData, surfaceLine); Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Configurations/MacroStabilityInwardsCalculationConfigurationImporter.cs =================================================================== diff -u -r8ebf5b222f3b052df95f6164ac488a5e7760cf68 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Configurations/MacroStabilityInwardsCalculationConfigurationImporter.cs (.../MacroStabilityInwardsCalculationConfigurationImporter.cs) (revision 8ebf5b222f3b052df95f6164ac488a5e7760cf68) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Configurations/MacroStabilityInwardsCalculationConfigurationImporter.cs (.../MacroStabilityInwardsCalculationConfigurationImporter.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -137,14 +137,14 @@ /// /// The calculation read from the imported file. /// The calculation to configure. - /// false when the has a + /// false when the has a /// set which is not available in , true otherwise. private bool TrySetSurfaceLine(MacroStabilityInwardsCalculationConfiguration calculationConfiguration, MacroStabilityInwardsCalculationScenario macroStabilityInwardsCalculation) { if (calculationConfiguration.SurfaceLineName != null) { - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = failureMechanism.SurfaceLines + MacroStabilityInwardsSurfaceLine surfaceLine = failureMechanism.SurfaceLines .FirstOrDefault(sl => sl.Name == calculationConfiguration.SurfaceLineName); if (surfaceLine == null) @@ -170,7 +170,7 @@ /// /// the has a set /// which is not available in the failure mechanism. - /// The does not intersect with the + /// The does not intersect with the /// when this is set. /// /// true otherwise. Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Importers/MacroStabilityInwardsSurfaceLineExtensions.cs =================================================================== diff -u -rb2d6fb0b948754d598692e76e2dc1a25b311d7e7 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Importers/MacroStabilityInwardsSurfaceLineExtensions.cs (.../MacroStabilityInwardsSurfaceLineExtensions.cs) (revision b2d6fb0b948754d598692e76e2dc1a25b311d7e7) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Importers/MacroStabilityInwardsSurfaceLineExtensions.cs (.../MacroStabilityInwardsSurfaceLineExtensions.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -31,7 +31,7 @@ namespace Ringtoets.MacroStabilityInwards.IO.Importers { /// - /// Extension methods for the class. + /// Extension methods for the class. /// public static class MacroStabilityInwardsSurfaceLineExtensions { @@ -46,7 +46,7 @@ /// Thrown when is null. /// Thrown when a mandatory characteristic point is not /// present or not on the given . - public static void SetCharacteristicPoints(this RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, CharacteristicPoints characteristicPoints) + public static void SetCharacteristicPoints(this MacroStabilityInwardsSurfaceLine surfaceLine, CharacteristicPoints characteristicPoints) { if (surfaceLine == null) { @@ -75,13 +75,13 @@ } /// - /// Tries to set the at the location of + /// Tries to set the at the location of /// . /// - /// The to set the - /// for. - /// The point at which to set the . - private static void TrySetDitchPolderSide(this RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + /// The to set the + /// for. + /// The point at which to set the . + private static void TrySetDitchPolderSide(this MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) { if (point != null) { @@ -97,13 +97,13 @@ } /// - /// Tries to set the at the location of + /// Tries to set the at the location of /// . /// - /// The to set the - /// for. - /// The point at which to set the . - private static void TrySetBottomDitchPolderSide(this RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + /// The to set the + /// for. + /// The point at which to set the . + private static void TrySetBottomDitchPolderSide(this MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) { if (point != null) { @@ -119,13 +119,13 @@ } /// - /// Tries to set the at the location of + /// Tries to set the at the location of /// . /// - /// The to set the - /// for. - /// The point at which to set the . - private static void TrySetBottomDitchDikeSide(this RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + /// The to set the + /// for. + /// The point at which to set the . + private static void TrySetBottomDitchDikeSide(this MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) { if (point != null) { @@ -141,13 +141,13 @@ } /// - /// Tries to set the at the location of + /// Tries to set the at the location of /// . /// - /// The to set the - /// for. - /// The point at which to set the . - private static void TrySetDitchDikeSide(this RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + /// The to set the + /// for. + /// The point at which to set the . + private static void TrySetDitchDikeSide(this MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) { if (point != null) { @@ -163,15 +163,15 @@ } /// - /// Tries to set the at the location of + /// Tries to set the at the location of /// . /// - /// The to set the - /// for. - /// The point at which to set the . + /// The to set the + /// for. + /// The point at which to set the . /// Thrown when is null or /// not on the . - private static void TrySetSurfaceLevelInside(this RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + private static void TrySetSurfaceLevelInside(this MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) { try { @@ -188,15 +188,15 @@ } /// - /// Tries to set the at the location of + /// Tries to set the at the location of /// . /// - /// The to set the - /// for. - /// The point at which to set the . + /// The to set the + /// for. + /// The point at which to set the . /// Thrown when is null or /// not on the . - private static void TrySetSurfaceLevelOutside(this RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + private static void TrySetSurfaceLevelOutside(this MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) { try { @@ -213,15 +213,15 @@ } /// - /// Tries to set the at the location of + /// Tries to set the at the location of /// . /// - /// The to set the - /// for. - /// The point at which to set the . + /// The to set the + /// for. + /// The point at which to set the . /// Thrown when is null or /// not on the . - private static void TrySetDikeTopAtPolder(this RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + private static void TrySetDikeTopAtPolder(this MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) { try { @@ -238,13 +238,13 @@ } /// - /// Tries to set the at the location of + /// Tries to set the at the location of /// . /// - /// The to set the - /// for. - /// The point at which to set the . - private static void TrySetShoulderBaseInside(this RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + /// The to set the + /// for. + /// The point at which to set the . + private static void TrySetShoulderBaseInside(this MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) { if (point != null) { @@ -260,13 +260,13 @@ } /// - /// Tries to set the at the location of + /// Tries to set the at the location of /// . /// - /// The to set the - /// for. - /// The point at which to set the . - private static void TrySetShoulderTopInside(this RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + /// The to set the + /// for. + /// The point at which to set the . + private static void TrySetShoulderTopInside(this MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) { if (point != null) { @@ -282,13 +282,13 @@ } /// - /// Tries to set the at the location of + /// Tries to set the at the location of /// . /// - /// The to set the - /// for. - /// The point at which to set the . - private static void TrySetTrafficLoadInside(this RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + /// The to set the + /// for. + /// The point at which to set the . + private static void TrySetTrafficLoadInside(this MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) { if (point != null) { @@ -304,13 +304,13 @@ } /// - /// Tries to set the at the location of + /// Tries to set the at the location of /// . /// - /// The to set the - /// for. - /// The point at which to set the . - private static void TrySetTrafficLoadOutside(this RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + /// The to set the + /// for. + /// The point at which to set the . + private static void TrySetTrafficLoadOutside(this MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) { if (point != null) { @@ -326,15 +326,15 @@ } /// - /// Tries to set the at the location of + /// Tries to set the at the location of /// . /// - /// The to set the - /// for. - /// The point at which to set the . + /// The to set the + /// for. + /// The point at which to set the . /// Thrown when is null or /// not on the . - private static void TrySetDikeToeAtRiver(this RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + private static void TrySetDikeToeAtRiver(this MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) { try { @@ -351,15 +351,15 @@ } /// - /// Tries to set the at the location of + /// Tries to set the at the location of /// . /// - /// The to set the - /// for. - /// The point at which to set the . + /// The to set the + /// for. + /// The point at which to set the . /// Thrown when is null or /// not on the . - private static void TrySetDikeToeAtPolder(this RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + private static void TrySetDikeToeAtPolder(this MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) { try { @@ -375,7 +375,7 @@ } } - private static void LogOptionalCharacteristicPointError(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, ArgumentException e) + private static void LogOptionalCharacteristicPointError(MacroStabilityInwardsSurfaceLine surfaceLine, ArgumentException e) { log.ErrorFormat(RingtoetsCommonIoResources.SurfaceLinesCsvImporter_CharacteristicPoint_of_SurfaceLine_0_skipped_cause_1_, surfaceLine.Name, Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Importers/MacroStabilityInwardsSurfaceLineTransformer.cs =================================================================== diff -u -rdf853f988ad99b935860c361bc000f6aba9876a7 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Importers/MacroStabilityInwardsSurfaceLineTransformer.cs (.../MacroStabilityInwardsSurfaceLineTransformer.cs) (revision df853f988ad99b935860c361bc000f6aba9876a7) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Importers/MacroStabilityInwardsSurfaceLineTransformer.cs (.../MacroStabilityInwardsSurfaceLineTransformer.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -28,9 +28,9 @@ namespace Ringtoets.MacroStabilityInwards.IO.Importers { /// - /// Transforms generic into macro stability specific . + /// Transforms generic into macro stability specific . /// - public class MacroStabilityInwardsSurfaceLineTransformer : ISurfaceLineTransformer + public class MacroStabilityInwardsSurfaceLineTransformer : ISurfaceLineTransformer { private readonly ReferenceLine referenceLine; @@ -49,11 +49,11 @@ this.referenceLine = referenceLine; } - public RingtoetsMacroStabilityInwardsSurfaceLine Transform(SurfaceLine surfaceLine, CharacteristicPoints characteristicPoints) + public MacroStabilityInwardsSurfaceLine Transform(SurfaceLine surfaceLine, CharacteristicPoints characteristicPoints) { Point2D intersectionPoint = surfaceLine.GetSingleReferenceLineInterSection(referenceLine); - var macroStabilityInwardsSurfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var macroStabilityInwardsSurfaceLine = new MacroStabilityInwardsSurfaceLine { Name = surfaceLine.Name }; Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculatorInput.cs =================================================================== diff -u -rd47809e3a8fadff2be5b10056b79b16dc27eeca2 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculatorInput.cs (.../MacroStabilityInwardsCalculatorInput.cs) (revision d47809e3a8fadff2be5b10056b79b16dc27eeca2) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculatorInput.cs (.../MacroStabilityInwardsCalculatorInput.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -70,7 +70,7 @@ /// /// Gets the surface line. /// - public RingtoetsMacroStabilityInwardsSurfaceLine SurfaceLine { internal get; set; } + public MacroStabilityInwardsSurfaceLine SurfaceLine { internal get; set; } /// /// Gets the profile which contains a 1 dimensional definition of soil layers with properties. @@ -91,7 +91,7 @@ /// /// Gets the surface line. /// - public RingtoetsMacroStabilityInwardsSurfaceLine SurfaceLine { get; private set; } + public MacroStabilityInwardsSurfaceLine SurfaceLine { get; private set; } /// /// Gets the profile which contains a 1 dimensional definition of soil layers with properties. Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/FileImporter/MacroStabilityInwardsSurfaceLineReplaceDataStrategy.cs =================================================================== diff -u -ra940166534b3dd6e778de2e7c8e7e5241f3d3381 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/FileImporter/MacroStabilityInwardsSurfaceLineReplaceDataStrategy.cs (.../MacroStabilityInwardsSurfaceLineReplaceDataStrategy.cs) (revision a940166534b3dd6e778de2e7c8e7e5241f3d3381) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/FileImporter/MacroStabilityInwardsSurfaceLineReplaceDataStrategy.cs (.../MacroStabilityInwardsSurfaceLineReplaceDataStrategy.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -33,8 +33,8 @@ /// /// A to replace the surface lines with the imported surface lines. /// - public class MacroStabilityInwardsSurfaceLineReplaceDataStrategy : ReplaceDataStrategyBase, - ISurfaceLineUpdateDataStrategy + public class MacroStabilityInwardsSurfaceLineReplaceDataStrategy : ReplaceDataStrategyBase, + ISurfaceLineUpdateDataStrategy { /// /// Creates a new instance of . @@ -44,7 +44,7 @@ public MacroStabilityInwardsSurfaceLineReplaceDataStrategy(MacroStabilityInwardsFailureMechanism failureMechanism) : base(failureMechanism, failureMechanism?.SurfaceLines) {} - public IEnumerable UpdateSurfaceLinesWithImportedData(IEnumerable readSurfaceLines, + public IEnumerable UpdateSurfaceLinesWithImportedData(IEnumerable readSurfaceLines, string sourceFilePath) { return ReplaceTargetCollectionWithImportedData(readSurfaceLines, sourceFilePath); Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/FileImporter/MacroStabilityInwardsSurfaceLineUpdateDataStrategy.cs =================================================================== diff -u -ra940166534b3dd6e778de2e7c8e7e5241f3d3381 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/FileImporter/MacroStabilityInwardsSurfaceLineUpdateDataStrategy.cs (.../MacroStabilityInwardsSurfaceLineUpdateDataStrategy.cs) (revision a940166534b3dd6e778de2e7c8e7e5241f3d3381) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/FileImporter/MacroStabilityInwardsSurfaceLineUpdateDataStrategy.cs (.../MacroStabilityInwardsSurfaceLineUpdateDataStrategy.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -36,47 +36,47 @@ /// /// An for updating surface lines based on imported data. /// - public class MacroStabilityInwardsSurfaceLineUpdateDataStrategy : UpdateDataStrategyBase, - ISurfaceLineUpdateDataStrategy + public class MacroStabilityInwardsSurfaceLineUpdateDataStrategy : UpdateDataStrategyBase, + ISurfaceLineUpdateDataStrategy { /// /// Creates a new instance of . /// /// The failure mechanism in which the surface lines are updated. /// Thrown when is null. public MacroStabilityInwardsSurfaceLineUpdateDataStrategy(MacroStabilityInwardsFailureMechanism failureMechanism) - : base(failureMechanism, failureMechanism?.SurfaceLines, new RingtoetsMacroStabilityInwardsSurfaceLineNameEqualityComparer()) {} + : base(failureMechanism, failureMechanism?.SurfaceLines, new MacroStabilityInwardsSurfaceLineNameEqualityComparer()) {} - public IEnumerable UpdateSurfaceLinesWithImportedData(IEnumerable surfaceLines, string sourceFilePath) + public IEnumerable UpdateSurfaceLinesWithImportedData(IEnumerable surfaceLines, string sourceFilePath) { return UpdateTargetCollectionData(surfaceLines, sourceFilePath); } - protected override IEnumerable RemoveObjectAndDependentData(RingtoetsMacroStabilityInwardsSurfaceLine removedSurfaceLine) + protected override IEnumerable RemoveObjectAndDependentData(MacroStabilityInwardsSurfaceLine removedSurfaceLine) { return MacroStabilityInwardsDataSynchronizationService.RemoveSurfaceLine(FailureMechanism, removedSurfaceLine); } /// - /// Class for comparing by only the name. + /// Class for comparing by only the name. /// - private class RingtoetsMacroStabilityInwardsSurfaceLineNameEqualityComparer : IEqualityComparer + private class MacroStabilityInwardsSurfaceLineNameEqualityComparer : IEqualityComparer { - public bool Equals(RingtoetsMacroStabilityInwardsSurfaceLine x, RingtoetsMacroStabilityInwardsSurfaceLine y) + public bool Equals(MacroStabilityInwardsSurfaceLine x, MacroStabilityInwardsSurfaceLine y) { return x.Name == y.Name; } - public int GetHashCode(RingtoetsMacroStabilityInwardsSurfaceLine obj) + public int GetHashCode(MacroStabilityInwardsSurfaceLine obj) { return obj.Name.GetHashCode(); } } #region Updating Data Functions - protected override IEnumerable UpdateObjectAndDependentData(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLineToUpdate, - RingtoetsMacroStabilityInwardsSurfaceLine matchingSurfaceLine) + protected override IEnumerable UpdateObjectAndDependentData(MacroStabilityInwardsSurfaceLine surfaceLineToUpdate, + MacroStabilityInwardsSurfaceLine matchingSurfaceLine) { surfaceLineToUpdate.CopyProperties(matchingSurfaceLine); @@ -88,7 +88,7 @@ return affectedObjects; } - private IEnumerable UpdateSurfaceLineDependentData(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + private IEnumerable UpdateSurfaceLineDependentData(MacroStabilityInwardsSurfaceLine surfaceLine) { IEnumerable affectedCalculations = GetAffectedCalculationWithSurfaceLine(surfaceLine); @@ -100,7 +100,7 @@ return affectedObjects; } - private IEnumerable UpdateStochasticSoilModel(RingtoetsMacroStabilityInwardsSurfaceLine updatedSurfaceLine) + private IEnumerable UpdateStochasticSoilModel(MacroStabilityInwardsSurfaceLine updatedSurfaceLine) { IEnumerable calculationsToUpdate = GetAffectedCalculationWithSurfaceLine(updatedSurfaceLine); @@ -117,7 +117,7 @@ return affectedObjects; } - private IEnumerable GetAffectedCalculationWithSurfaceLine(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + private IEnumerable GetAffectedCalculationWithSurfaceLine(MacroStabilityInwardsSurfaceLine surfaceLine) { IEnumerable affectedCalculations = FailureMechanism.Calculations @@ -126,7 +126,7 @@ return affectedCalculations; } - private IEnumerable GetAvailableStochasticSoilModels(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + private IEnumerable GetAvailableStochasticSoilModels(MacroStabilityInwardsSurfaceLine surfaceLine) { return MacroStabilityInwardsCalculationConfigurationHelper.GetStochasticSoilModelsForSurfaceLine(surfaceLine, FailureMechanism.StochasticSoilModels); Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/FileImporter/SurfaceLinesCsvImporterConfigurationFactory.cs =================================================================== diff -u -rdf853f988ad99b935860c361bc000f6aba9876a7 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/FileImporter/SurfaceLinesCsvImporterConfigurationFactory.cs (.../SurfaceLinesCsvImporterConfigurationFactory.cs) (revision df853f988ad99b935860c361bc000f6aba9876a7) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/FileImporter/SurfaceLinesCsvImporterConfigurationFactory.cs (.../SurfaceLinesCsvImporterConfigurationFactory.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -38,9 +38,9 @@ /// The failure mechanism to replace the surface lines for. /// The reference line to use for matching imported surface lines on. /// The configuration for the replace operation. - public static SurfaceLinesCsvImporterConfiguration CreateReplaceStrategyConfiguration(MacroStabilityInwardsFailureMechanism failureMechanism, ReferenceLine referenceLine) + public static SurfaceLinesCsvImporterConfiguration CreateReplaceStrategyConfiguration(MacroStabilityInwardsFailureMechanism failureMechanism, ReferenceLine referenceLine) { - return new SurfaceLinesCsvImporterConfiguration( + return new SurfaceLinesCsvImporterConfiguration( new MacroStabilityInwardsSurfaceLineTransformer(referenceLine), new MacroStabilityInwardsSurfaceLineReplaceDataStrategy(failureMechanism)); } @@ -51,9 +51,9 @@ /// The failure mechanism to update the surface lines for. /// The reference line to use for matching imported surface lines on. /// The configuration for the update operation. - public static SurfaceLinesCsvImporterConfiguration CreateUpdateStrategyConfiguration(MacroStabilityInwardsFailureMechanism failureMechanism, ReferenceLine referenceLine) + public static SurfaceLinesCsvImporterConfiguration CreateUpdateStrategyConfiguration(MacroStabilityInwardsFailureMechanism failureMechanism, ReferenceLine referenceLine) { - return new SurfaceLinesCsvImporterConfiguration( + return new SurfaceLinesCsvImporterConfiguration( new MacroStabilityInwardsSurfaceLineTransformer(referenceLine), new MacroStabilityInwardsSurfaceLineUpdateDataStrategy(failureMechanism)); } Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs =================================================================== diff -u -rcfe30fb624bcc031454e7ff22e333386ed6ead87 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs (.../MacroStabilityInwardsPlugin.cs) (revision cfe30fb624bcc031454e7ff22e333386ed6ead87) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs (.../MacroStabilityInwardsPlugin.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -75,11 +75,11 @@ CreateInstance = context => new MacroStabilityInwardsInputContextProperties(context, new ObservablePropertyChangeHandler(context.MacroStabilityInwardsCalculation, context.WrappedData)) }; yield return new PropertyInfo(); - yield return new PropertyInfo + yield return new PropertyInfo { - CreateInstance = context => new RingtoetsMacroStabilityInwardsSurfaceLineCollectionProperties(context.WrappedData) + CreateInstance = context => new MacroStabilityInwardsSurfaceLineCollectionProperties(context.WrappedData) }; - yield return new PropertyInfo(); + yield return new PropertyInfo(); yield return new PropertyInfo { CreateInstance = context => new StochasticSoilModelCollectionProperties(context.WrappedData) @@ -90,14 +90,14 @@ public override IEnumerable GetImportInfos() { - yield return new ImportInfo + yield return new ImportInfo { Name = RingtoetsCommonDataResources.SurfaceLineCollection_TypeDescriptor, Category = RingtoetsCommonFormsResources.Ringtoets_Category, Image = MacroStabilityInwardsFormsResources.SurfaceLineIcon, FileFilterGenerator = SurfaceLineFileFilter, IsEnabled = context => context.AssessmentSection.ReferenceLine != null, - CreateFileImporter = (context, filePath) => new SurfaceLinesCsvImporter( + CreateFileImporter = (context, filePath) => new SurfaceLinesCsvImporter( context.WrappedData, filePath, new ImportMessageProvider(), @@ -140,15 +140,15 @@ public override IEnumerable GetUpdateInfos() { - yield return new UpdateInfo + yield return new UpdateInfo { Name = RingtoetsCommonDataResources.SurfaceLineCollection_TypeDescriptor, Category = RingtoetsCommonFormsResources.Ringtoets_Category, Image = MacroStabilityInwardsFormsResources.SurfaceLineIcon, FileFilterGenerator = SurfaceLineFileFilter, IsEnabled = context => context.WrappedData.SourcePath != null, CurrentPath = context => context.WrappedData.SourcePath, - CreateFileImporter = (context, filePath) => new SurfaceLinesCsvImporter( + CreateFileImporter = (context, filePath) => new SurfaceLinesCsvImporter( context.WrappedData, filePath, new UpdateMessageProvider(), @@ -265,16 +265,16 @@ .Build() }; - yield return new TreeNodeInfo + yield return new TreeNodeInfo { Text = context => RingtoetsCommonDataResources.SurfaceLineCollection_TypeDescriptor, Image = context => RingtoetsCommonFormsResources.GeneralFolderIcon, ForeColor = context => context.WrappedData.Any() ? Color.FromKnownColor(KnownColor.ControlText) : Color.FromKnownColor(KnownColor.GrayText), ChildNodeObjects = context => context.WrappedData.Cast().ToArray(), - ContextMenuStrip = RingtoetsMacroStabilityInwardsSurfaceLinesContextContextMenuStrip + ContextMenuStrip = MacroStabilityInwardsSurfaceLinesContextContextMenuStrip }; - yield return new TreeNodeInfo + yield return new TreeNodeInfo { Text = surfaceLine => surfaceLine.Name, Image = surfaceLine => MacroStabilityInwardsFormsResources.SurfaceLineIcon, @@ -556,9 +556,9 @@ return null; } - #region RingtoetsMacroStabilityInwardsSurfaceLinesContext TreeNodeInfo + #region MacroStabilityInwardsSurfaceLinesContext TreeNodeInfo - private ContextMenuStrip RingtoetsMacroStabilityInwardsSurfaceLinesContextContextMenuStrip(RingtoetsMacroStabilityInwardsSurfaceLinesContext nodeData, object parentData, TreeViewControl treeViewControl) + private ContextMenuStrip MacroStabilityInwardsSurfaceLinesContextContextMenuStrip(MacroStabilityInwardsSurfaceLinesContext nodeData, object parentData, TreeViewControl treeViewControl) { return Gui.Get(nodeData, treeViewControl) .AddImportItem() @@ -677,7 +677,7 @@ return new ArrayList { new FailureMechanismSectionsContext(failureMechanism, assessmentSection), - new RingtoetsMacroStabilityInwardsSurfaceLinesContext(failureMechanism.SurfaceLines, failureMechanism, assessmentSection), + new MacroStabilityInwardsSurfaceLinesContext(failureMechanism.SurfaceLines, failureMechanism, assessmentSection), new StochasticSoilModelCollectionContext(failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection), failureMechanism.InputComments }; @@ -940,7 +940,7 @@ nodeData.NotifyObservers(); } - private static void GenerateCalculations(CalculationGroup target, IEnumerable surfaceLines, IEnumerable soilModels, GeneralMacroStabilityInwardsInput generalInput) + private static void GenerateCalculations(CalculationGroup target, IEnumerable surfaceLines, IEnumerable soilModels, GeneralMacroStabilityInwardsInput generalInput) { foreach (ICalculationBase group in MacroStabilityInwardsCalculationConfigurationHelper.GenerateCalculationItemsStructure(surfaceLines, soilModels, generalInput)) { @@ -971,7 +971,7 @@ } } - private bool VerifySurfaceLineUpdates(RingtoetsMacroStabilityInwardsSurfaceLinesContext context, string query) + private bool VerifySurfaceLineUpdates(MacroStabilityInwardsSurfaceLinesContext context, string query) { var changeHandler = new FailureMechanismCalculationChangeHandler(context.FailureMechanism, query, Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Exceptions/MacroStabilityInwardsSurfaceLineException.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Exceptions/MacroStabilityInwardsSurfaceLineException.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Exceptions/MacroStabilityInwardsSurfaceLineException.cs (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -0,0 +1,69 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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.Runtime.Serialization; + +namespace Ringtoets.MacroStabilityInwards.Primitives.Exceptions +{ + /// + /// The exception that is thrown when operations on encounter + /// an error. + /// + [Serializable] + public class MacroStabilityInwardsSurfaceLineException : Exception + { + /// + /// Initializes a new instance of the class. + /// + public MacroStabilityInwardsSurfaceLineException() {} + + /// + /// Initializes a new instance of the class + /// with a specified error message. + /// + /// The error message that explains the reason for the exception. + public MacroStabilityInwardsSurfaceLineException(string message) : base(message) {} + + /// + /// Initializes a new instance of the class + /// with a specified error message and a reference to the inner exception that is + /// the cause of this exception. + /// + /// The error message that explains the reason for the exception. + /// The exception that is the cause of the current exception, + /// or null if no inner exception is specified. + public MacroStabilityInwardsSurfaceLineException(string message, Exception inner) : base(message, inner) {} + + /// + /// Initializes a new instance of with + /// serialized data. + /// The that holds the serialized + /// object data about the exception being thrown. + /// The that contains contextual + /// information about the source or destination. + /// The parameter is + /// null. + /// The class name is null or + /// is zero (0). + protected MacroStabilityInwardsSurfaceLineException(SerializationInfo info, StreamingContext context) : base(info, context) {} + } +} \ No newline at end of file Fisheye: Tag cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Exceptions/RingtoetsMacroStabilityInwardsSurfaceLineException.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsSurfaceLine.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsSurfaceLine.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsSurfaceLine.cs (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -0,0 +1,660 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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 System.Collections.ObjectModel; +using System.Globalization; +using System.Linq; +using Core.Common.Base; +using Core.Common.Base.Data; +using Core.Common.Base.Geometry; +using Ringtoets.Common.Data; +using Ringtoets.MacroStabilityInwards.Primitives.Exceptions; +using Ringtoets.MacroStabilityInwards.Primitives.Properties; +using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; + +namespace Ringtoets.MacroStabilityInwards.Primitives +{ + /// + /// Definition of a surface line for macro stability inwards. + /// + public class MacroStabilityInwardsSurfaceLine : Observable, IMechanismSurfaceLine + { + private const int numberOfDecimalPlaces = 2; + + /// + /// Initializes a new instance of the class. + /// + public MacroStabilityInwardsSurfaceLine() + { + Name = string.Empty; + Points = new Point3D[0]; + LocalGeometry = new RoundedPoint2DCollection(2, new Point2D[0]); + } + + /// + /// Gets or sets the name of the surface line. + /// + public string Name { get; set; } + + /// + /// Gets the 3D points describing the geometry of the surface line. + /// + public Point3D[] Points { get; private set; } + + /// + /// Gets the first 3D geometry point defining the surface line in world coordinates. + /// + public Point3D StartingWorldPoint { get; private set; } + + /// + /// Gets the last 3D geometry point defining the surface line in world coordinates. + /// + public Point3D EndingWorldPoint { get; private set; } + + /// + /// Gets the location which generalizes the height of the surface + /// on the outside of the polder. + /// + public Point3D SurfaceLevelOutside { get; private set; } + + /// + /// Gets the location of dike toe when approaching from outside + /// the polder. + /// + public Point3D DikeToeAtRiver { get; private set; } + + /// + /// Gets the location of the start of traffic load when approaching + /// from outside the polder. + /// + public Point3D TrafficLoadOutside { get; private set; } + + /// + /// Gets the location of the start of traffic load when approaching + /// from inside the polder. + /// + public Point3D TrafficLoadInside { get; private set; } + + /// + /// Gets the location of the top of the dike when approaching from + /// inside the polder. + /// + public Point3D DikeTopAtPolder { get; private set; } + + /// + /// Gets the location where the shoulder on the side of the polder + /// connects with the dike. + /// + public Point3D ShoulderBaseInside { get; private set; } + + /// + /// Gets the location where the shoulder on the side of the polder + /// declines towards the location of the dike toe when approaching from inside + /// the polder. + /// + public Point3D ShoulderTopInside { get; private set; } + + /// + /// Gets the location of dike toe when approaching from inside + /// the polder. + /// + public Point3D DikeToeAtPolder { get; private set; } + + /// + /// Gets the location of the start of the ditch when approaching + /// from the dike. + /// + public Point3D DitchDikeSide { get; private set; } + + /// + /// Gets the location of the bottom of the ditch when approaching + /// from the dike. + /// + public Point3D BottomDitchDikeSide { get; private set; } + + /// + /// Gets the location of the bottom of the ditch when approaching + /// from inside the polder. + /// + public Point3D BottomDitchPolderSide { get; private set; } + + /// + /// Gets the location of the start of the ditch when approaching from + /// inside the polder. + /// + public Point3D DitchPolderSide { get; private set; } + + /// + /// Gets the location which generalizes the surface level on the + /// inside of the polder. + /// + public Point3D SurfaceLevelInside { get; private set; } + + /// + /// Gets or sets the reference line intersection point in world coordinates. + /// + public Point2D ReferenceLineIntersectionWorldPoint { get; set; } + + /// + /// Gets the 2D points describing the local geometry of the surface line. + /// + public RoundedPoint2DCollection LocalGeometry { get; private set; } + + /// + /// Sets the geometry of the surface line. + /// + /// The collection of points defining the surface line geometry. + /// Thrown when is null. + /// Thrown when any element of is null. + public void SetGeometry(IEnumerable points) + { + if (points == null) + { + throw new ArgumentNullException(nameof(points), Resources.MacroStabilityInwardsSurfaceLine_Collection_of_points_for_geometry_is_null); + } + if (points.Any(p => p == null)) + { + throw new ArgumentException(Resources.MacroStabilityInwardsSurfaceLine_A_point_in_the_collection_was_null); + } + Points = points.Select(p => new Point3D(p)).ToArray(); + + if (Points.Length > 0) + { + StartingWorldPoint = Points[0]; + EndingWorldPoint = Points[Points.Length - 1]; + } + + LocalGeometry = new RoundedPoint2DCollection(numberOfDecimalPlaces, Points.ProjectToLZ().ToArray()); + } + + /// + /// Sets the at the given point. + /// + /// The location as a which to set as the . + /// Thrown when doesn't contain a at + /// . + /// Thrown when is null. + public void SetDitchPolderSideAt(Point3D point) + { + Point3D geometryPoint = GetPointFromGeometry(point); + if (geometryPoint == null) + { + throw CreatePointNotInGeometryException(point, RingtoetsCommonDataResources.CharacteristicPoint_DitchPolderSide); + } + DitchPolderSide = geometryPoint; + } + + /// + /// Sets the at the given point. + /// + /// The location as a which to set as the . + /// Thrown when doesn't contain a at + /// . + /// Thrown when is null. + public void SetBottomDitchPolderSideAt(Point3D point) + { + Point3D geometryPoint = GetPointFromGeometry(point); + if (geometryPoint == null) + { + throw CreatePointNotInGeometryException(point, RingtoetsCommonDataResources.CharacteristicPoint_BottomDitchPolderSide); + } + BottomDitchPolderSide = geometryPoint; + } + + /// + /// Sets the at the given point. + /// + /// The location as a which to set as the . + /// Thrown when doesn't contain a at + /// . + /// Thrown when is null. + public void SetBottomDitchDikeSideAt(Point3D point) + { + Point3D geometryPoint = GetPointFromGeometry(point); + if (geometryPoint == null) + { + throw CreatePointNotInGeometryException(point, RingtoetsCommonDataResources.CharacteristicPoint_BottomDitchDikeSide); + } + BottomDitchDikeSide = geometryPoint; + } + + /// + /// Sets the at the given point. + /// + /// The location as a which to set as the . + /// Thrown when doesn't contain a at + /// . + /// Thrown when is null. + public void SetDitchDikeSideAt(Point3D point) + { + Point3D geometryPoint = GetPointFromGeometry(point); + if (geometryPoint == null) + { + throw CreatePointNotInGeometryException(point, RingtoetsCommonDataResources.CharacteristicPoint_DitchDikeSide); + } + DitchDikeSide = geometryPoint; + } + + /// + /// Sets the at the given point. + /// + /// The location as a which to set as the . + /// Thrown when doesn't contain a at + /// . + /// Thrown when is null. + public void SetDikeTopAtPolderAt(Point3D point) + { + Point3D geometryPoint = GetPointFromGeometry(point); + if (geometryPoint == null) + { + throw CreatePointNotInGeometryException(point, RingtoetsCommonDataResources.CharacteristicPoint_DikeTopAtPolder); + } + DikeTopAtPolder = geometryPoint; + } + + /// + /// Sets the at the given point. + /// + /// The location as a which to set as the . + /// Thrown when doesn't contain a at + /// . + /// Thrown when is null. + public void SetShoulderBaseInsideAt(Point3D point) + { + Point3D geometryPoint = GetPointFromGeometry(point); + if (geometryPoint == null) + { + throw CreatePointNotInGeometryException(point, RingtoetsCommonDataResources.CharacteristicPoint_ShoulderBaseInside); + } + ShoulderBaseInside = geometryPoint; + } + + /// + /// Sets the at the given point. + /// + /// The location as a which to set as the . + /// Thrown when doesn't contain a at + /// . + /// Thrown when is null. + public void SetShoulderTopInsideAt(Point3D point) + { + Point3D geometryPoint = GetPointFromGeometry(point); + if (geometryPoint == null) + { + throw CreatePointNotInGeometryException(point, RingtoetsCommonDataResources.CharacteristicPoint_ShoulderTopInside); + } + ShoulderTopInside = geometryPoint; + } + + /// + /// Sets the at the given point. + /// + /// The location as a which to set as the . + /// Thrown when doesn't contain a at + /// . + /// Thrown when is null. + public void SetTrafficLoadInsideAt(Point3D point) + { + Point3D geometryPoint = GetPointFromGeometry(point); + if (geometryPoint == null) + { + throw CreatePointNotInGeometryException(point, RingtoetsCommonDataResources.CharacteristicPoint_TrafficLoadInside); + } + TrafficLoadInside = geometryPoint; + } + + /// + /// Sets the at the given point. + /// + /// The location as a which to set as the . + /// Thrown when doesn't contain a at + /// . + /// Thrown when is null. + public void SetTrafficLoadOutsideAt(Point3D point) + { + Point3D geometryPoint = GetPointFromGeometry(point); + if (geometryPoint == null) + { + throw CreatePointNotInGeometryException(point, RingtoetsCommonDataResources.CharacteristicPoint_TrafficLoadOutside); + } + TrafficLoadOutside = geometryPoint; + } + + /// + /// Sets the at the given point. + /// + /// The location as a which to set as the . + /// Thrown when doesn't contain a at + /// . + /// Thrown when is null. + public void SetDikeToeAtRiverAt(Point3D point) + { + Point3D geometryPoint = GetPointFromGeometry(point); + if (geometryPoint == null) + { + throw CreatePointNotInGeometryException(point, RingtoetsCommonDataResources.CharacteristicPoint_DikeToeAtRiver); + } + DikeToeAtRiver = geometryPoint; + } + + /// + /// Sets the at the given point. + /// + /// The location as a which to set as the . + /// Thrown when doesn't contain a at + /// . + /// Thrown when is null. + public void SetDikeToeAtPolderAt(Point3D point) + { + Point3D geometryPoint = GetPointFromGeometry(point); + if (geometryPoint == null) + { + throw CreatePointNotInGeometryException(point, RingtoetsCommonDataResources.CharacteristicPoint_DikeToeAtPolder); + } + DikeToeAtPolder = geometryPoint; + } + + /// + /// Sets the at the given point. + /// + /// The location as a which to set as the . + /// Thrown when doesn't contain a at + /// . + /// Thrown when is null. + public void SetSurfaceLevelInsideAt(Point3D point) + { + Point3D geometryPoint = GetPointFromGeometry(point); + if (geometryPoint == null) + { + throw CreatePointNotInGeometryException(point, RingtoetsCommonDataResources.CharacteristicPoint_SurfaceLevelInside); + } + SurfaceLevelInside = geometryPoint; + } + + /// + /// Sets the at the given point. + /// + /// The location as a which to set as the . + /// Thrown when doesn't contain a at + /// . + /// Thrown when is null. + public void SetSurfaceLevelOutsideAt(Point3D point) + { + Point3D geometryPoint = GetPointFromGeometry(point); + if (geometryPoint == null) + { + throw CreatePointNotInGeometryException(point, RingtoetsCommonDataResources.CharacteristicPoint_SurfaceLevelOutside); + } + SurfaceLevelOutside = geometryPoint; + } + + /// + /// Gets the height of the projected at a L=. + /// + /// The L coordinate from where to take the height of the . + /// The height of the at L=. + /// Thrown when the + /// intersection point at have a significant difference in their y coordinate. + /// Thrown when is not in range of the LZ-projected . + /// Thrown when is empty. + public double GetZAtL(RoundedDouble l) + { + ValidateHasPoints(); + + if (!ValidateInRange(l)) + { + var localRangeL = new Range(LocalGeometry.First().X, LocalGeometry.Last().X); + string outOfRangeMessage = string.Format(Resources.MacroStabilityInwardsSurfaceLine_0_L_needs_to_be_in_Range_1_, + Resources.MacroStabilityInwardsSurfaceLine_GetZAtL_Cannot_determine_height, + localRangeL.ToString(FormattableConstants.ShowAtLeastOneDecimal, CultureInfo.CurrentCulture)); + throw new ArgumentOutOfRangeException(null, outOfRangeMessage); + } + + var segments = new Collection(); + for (var i = 1; i < LocalGeometry.Count(); i++) + { + segments.Add(new Segment2D(LocalGeometry.ElementAt(i - 1), LocalGeometry.ElementAt(i))); + } + + IEnumerable intersectionPoints = Math2D.SegmentsIntersectionWithVerticalLine(segments, l).OrderBy(p => p.Y).ToArray(); + + const double intersectionTolerance = 1e-2; + bool equalIntersections = Math.Abs(intersectionPoints.First().Y - intersectionPoints.Last().Y) < intersectionTolerance; + + if (equalIntersections) + { + return intersectionPoints.First().Y; + } + + string message = string.Format(Resources.MacroStabilityInwardsSurfaceLine_Cannot_determine_reliable_z_when_surface_line_is_vertical_in_l, l); + throw new MacroStabilityInwardsSurfaceLineException(message); + } + + /// + /// Checks whether is in range of the geometry projected in local coordinate system + /// where the points are ordered on the L-coordinate being monotonically non-decreasing. + /// + /// The local L-coordinate value to check for. + /// true when local L-coordinate is in range of the local geometry. false otherwise. + public bool ValidateInRange(double localCoordinateL) + { + Point2D firstLocalPoint = LocalGeometry.First(); + Point2D lastLocalPoint = LocalGeometry.Last(); + var roundedLocalCoordinateL = new RoundedDouble(numberOfDecimalPlaces, localCoordinateL); + return !(firstLocalPoint.X > roundedLocalCoordinateL) && !(lastLocalPoint.X < roundedLocalCoordinateL); + } + + /// + /// Gets the local coordinate with rounded values based on the geometry of the surface line and the given world coordinate. + /// + /// The world coordinate to get the local coordinate for. + /// The local coordinate. + public Point2D GetLocalPointFromGeometry(Point3D worldCoordinate) + { + int count = Points.Length; + if (count <= 1) + { + return new Point2D(double.NaN, double.NaN); + } + + Point3D first = Points.First(); + Point3D last = Points.Last(); + var firstPoint = new Point2D(first.X, first.Y); + var lastPoint = new Point2D(last.X, last.Y); + + Point2D localCoordinate = worldCoordinate.ProjectIntoLocalCoordinates(firstPoint, lastPoint); + return new Point2D(new RoundedDouble(numberOfDecimalPlaces, localCoordinate.X), + new RoundedDouble(numberOfDecimalPlaces, localCoordinate.Y)); + } + + /// + /// Copies the property values of the to + /// the . + /// + /// The + /// to get the property values from. + /// Thrown when + /// is null. + public void CopyProperties(MacroStabilityInwardsSurfaceLine fromSurfaceLine) + { + if (fromSurfaceLine == null) + { + throw new ArgumentNullException(nameof(fromSurfaceLine)); + } + + Name = fromSurfaceLine.Name; + ReferenceLineIntersectionWorldPoint = fromSurfaceLine.ReferenceLineIntersectionWorldPoint != null + ? new Point2D(fromSurfaceLine.ReferenceLineIntersectionWorldPoint) + : null; + SetGeometry(fromSurfaceLine.Points); + SetCharacteristicPoints(fromSurfaceLine); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) + { + return false; + } + if (ReferenceEquals(this, obj)) + { + return true; + } + var other = obj as MacroStabilityInwardsSurfaceLine; + return other != null && Equals((MacroStabilityInwardsSurfaceLine) obj); + } + + public override int GetHashCode() + { + unchecked + { + int hashCode = Name.GetHashCode(); + foreach (Point3D point in Points) + { + hashCode = (hashCode * 397) ^ point.GetHashCode(); + } + + hashCode = (hashCode * 397) ^ (SurfaceLevelInside?.GetHashCode() ?? 0); + hashCode = (hashCode * 397) ^ (SurfaceLevelOutside?.GetHashCode() ?? 0); + hashCode = (hashCode * 397) ^ (TrafficLoadInside?.GetHashCode() ?? 0); + hashCode = (hashCode * 397) ^ (TrafficLoadOutside?.GetHashCode() ?? 0); + hashCode = (hashCode * 397) ^ (DikeTopAtPolder?.GetHashCode() ?? 0); + hashCode = (hashCode * 397) ^ (ShoulderBaseInside?.GetHashCode() ?? 0); + hashCode = (hashCode * 397) ^ (ShoulderTopInside?.GetHashCode() ?? 0); + hashCode = (hashCode * 397) ^ (DikeToeAtPolder?.GetHashCode() ?? 0); + hashCode = (hashCode * 397) ^ (DikeToeAtRiver?.GetHashCode() ?? 0); + hashCode = (hashCode * 397) ^ (DitchDikeSide?.GetHashCode() ?? 0); + hashCode = (hashCode * 397) ^ (DitchPolderSide?.GetHashCode() ?? 0); + hashCode = (hashCode * 397) ^ (BottomDitchDikeSide?.GetHashCode() ?? 0); + hashCode = (hashCode * 397) ^ (BottomDitchPolderSide?.GetHashCode() ?? 0); + + return hashCode; + } + } + + public override string ToString() + { + return Name; + } + + private void SetCharacteristicPoints(MacroStabilityInwardsSurfaceLine fromSurfaceLine) + { + SurfaceLevelOutside = PointFromGeometryOrNull(fromSurfaceLine.SurfaceLevelOutside); + TrafficLoadOutside = PointFromGeometryOrNull(fromSurfaceLine.TrafficLoadOutside); + TrafficLoadInside = PointFromGeometryOrNull(fromSurfaceLine.TrafficLoadInside); + DikeTopAtPolder = PointFromGeometryOrNull(fromSurfaceLine.DikeTopAtPolder); + ShoulderBaseInside = PointFromGeometryOrNull(fromSurfaceLine.ShoulderBaseInside); + ShoulderTopInside = PointFromGeometryOrNull(fromSurfaceLine.ShoulderTopInside); + BottomDitchDikeSide = PointFromGeometryOrNull(fromSurfaceLine.BottomDitchDikeSide); + BottomDitchPolderSide = PointFromGeometryOrNull(fromSurfaceLine.BottomDitchPolderSide); + DikeToeAtPolder = PointFromGeometryOrNull(fromSurfaceLine.DikeToeAtPolder); + DikeToeAtRiver = PointFromGeometryOrNull(fromSurfaceLine.DikeToeAtRiver); + DitchDikeSide = PointFromGeometryOrNull(fromSurfaceLine.DitchDikeSide); + DitchPolderSide = PointFromGeometryOrNull(fromSurfaceLine.DitchPolderSide); + SurfaceLevelInside = PointFromGeometryOrNull(fromSurfaceLine.SurfaceLevelInside); + } + + private Point3D PointFromGeometryOrNull(Point3D point3D) + { + return point3D != null ? GetPointFromGeometry(point3D) : null; + } + + /// + /// Finds a point from which is at the same position as . + /// + /// The location of a point from . + /// The from at the same location as . + /// Thrown when is null. + private Point3D GetPointFromGeometry(Point3D point) + { + if (point == null) + { + throw new ArgumentNullException(nameof(point), @"Cannot find a point in geometry using a null point."); + } + return Points.FirstOrDefault(p => p.Equals(point)); + } + + private static ArgumentException CreatePointNotInGeometryException(Point3D point, string characteristicPointDescription) + { + string message = string.Format(Resources.MacroStabilityInwardsSurfaceLine_SetCharacteristicPointAt_Geometry_does_not_contain_point_at_0_to_assign_as_characteristic_point_1_, + point, + characteristicPointDescription); + return new ArgumentException(message); + } + + private bool Equals(MacroStabilityInwardsSurfaceLine other) + { + return string.Equals(Name, other.Name) + && Equals(ReferenceLineIntersectionWorldPoint, other.ReferenceLineIntersectionWorldPoint) + && EqualGeometricPoints(other.Points) + && EqualCharacteristicPoints(other); + } + + private bool EqualCharacteristicPoints(MacroStabilityInwardsSurfaceLine other) + { + return Equals(SurfaceLevelInside, other.SurfaceLevelInside) + && Equals(SurfaceLevelOutside, other.SurfaceLevelOutside) + && Equals(TrafficLoadInside, other.TrafficLoadInside) + && Equals(TrafficLoadOutside, other.TrafficLoadOutside) + && Equals(DikeTopAtPolder, other.DikeTopAtPolder) + && Equals(ShoulderBaseInside, other.ShoulderBaseInside) + && Equals(ShoulderTopInside, other.ShoulderTopInside) + && Equals(DikeToeAtPolder, other.DikeToeAtPolder) + && Equals(DikeToeAtRiver, other.DikeToeAtRiver) + && Equals(DitchDikeSide, other.DitchDikeSide) + && Equals(DitchPolderSide, other.DitchPolderSide) + && Equals(BottomDitchDikeSide, other.BottomDitchDikeSide) + && Equals(BottomDitchPolderSide, other.BottomDitchPolderSide); + } + + private bool EqualGeometricPoints(Point3D[] otherPoints) + { + int nrOfOtherPoints = otherPoints.Length; + if (Points.Length != nrOfOtherPoints) + { + return false; + } + + for (var index = 0; index < Points.Length; index++) + { + if (!Points[index].Equals(otherPoints[index])) + { + return false; + } + } + return true; + } + + /// + /// Checks whether the current collection is not empty. + /// + /// Thrown when is empty. + private void ValidateHasPoints() + { + if (!Points.Any()) + { + throw new InvalidOperationException(Resources.MacroStabilityInwardsSurfaceLine_SurfaceLine_has_no_Geometry); + } + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Properties/Resources.Designer.cs =================================================================== diff -u -r5579d8fdef4f553fb4ba94160825ec960b89bab9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 5579d8fdef4f553fb4ba94160825ec960b89bab9) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -100,68 +100,67 @@ } /// - /// Looks up a localized string similar to De geometrie bevat geen punt op locatie {0} om als '{1}' in te stellen.. + /// Looks up a localized string similar to {0} De lokale coördinaat moet in het bereik {1} liggen.. /// - public static string MacroStabilityInwardsSurfaceLine_SetCharacteristicPointAt_Geometry_does_not_contain_point_at_0_to_assign_as_characteristic_point_1_ { + public static string MacroStabilityInwardsSurfaceLine_0_L_needs_to_be_in_Range_1_ { get { - return ResourceManager.GetString("MacroStabilityInwardsSurfaceLine_SetCharacteristicPointAt_Geometry_does_not_conta" + - "in_point_at_0_to_assign_as_characteristic_point_1_", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSurfaceLine_0_L_needs_to_be_in_Range_1_", resourceCulture); } } /// - /// Looks up a localized string similar to {0} De lokale coördinaat moet in het bereik {1} liggen.. + /// Looks up a localized string similar to Een punt in de geometrie voor de profielschematisatie heeft geen waarde.. /// - public static string RingtoetsMacroStabilityInwardsSurfaceLine_0_L_needs_to_be_in_Range_1_ { + public static string MacroStabilityInwardsSurfaceLine_A_point_in_the_collection_was_null { get { - return ResourceManager.GetString("RingtoetsMacroStabilityInwardsSurfaceLine_0_L_needs_to_be_in_Range_1_", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSurfaceLine_A_point_in_the_collection_was_null", resourceCulture); } } /// - /// Looks up a localized string similar to Een punt in de geometrie voor de profielschematisatie heeft geen waarde.. + /// Looks up a localized string similar to Kan geen hoogte bepalen op het punt met de lokale coördinaat {0}, omdat de profielschematisatie verticaal loopt op dat punt.. /// - public static string RingtoetsMacroStabilityInwardsSurfaceLine_A_point_in_the_collection_was_null { + public static string MacroStabilityInwardsSurfaceLine_Cannot_determine_reliable_z_when_surface_line_is_vertical_in_l { get { - return ResourceManager.GetString("RingtoetsMacroStabilityInwardsSurfaceLine_A_point_in_the_collection_was_null", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSurfaceLine_Cannot_determine_reliable_z_when_surface_line_is" + + "_vertical_in_l", resourceCulture); } } /// - /// Looks up a localized string similar to Kan geen hoogte bepalen op het punt met de lokale coördinaat {0}, omdat de profielschematisatie verticaal loopt op dat punt.. + /// Looks up a localized string similar to De geometrie die opgegeven werd voor de profielschematisatie heeft geen waarde.. /// - public static string RingtoetsMacroStabilityInwardsSurfaceLine_Cannot_determine_reliable_z_when_surface_line_is_vertical_in_l { + public static string MacroStabilityInwardsSurfaceLine_Collection_of_points_for_geometry_is_null { get { - return ResourceManager.GetString("RingtoetsMacroStabilityInwardsSurfaceLine_Cannot_determine_reliable_z_when_surfac" + - "e_line_is_vertical_in_l", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSurfaceLine_Collection_of_points_for_geometry_is_null", resourceCulture); } } /// - /// Looks up a localized string similar to De geometrie die opgegeven werd voor de profielschematisatie heeft geen waarde.. + /// Looks up a localized string similar to Kan geen hoogte bepalen.. /// - public static string RingtoetsMacroStabilityInwardsSurfaceLine_Collection_of_points_for_geometry_is_null { + public static string MacroStabilityInwardsSurfaceLine_GetZAtL_Cannot_determine_height { get { - return ResourceManager.GetString("RingtoetsMacroStabilityInwardsSurfaceLine_Collection_of_points_for_geometry_is_nu" + - "ll", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSurfaceLine_GetZAtL_Cannot_determine_height", resourceCulture); } } /// - /// Looks up a localized string similar to Kan geen hoogte bepalen.. + /// Looks up a localized string similar to De geometrie bevat geen punt op locatie {0} om als '{1}' in te stellen.. /// - public static string RingtoetsMacroStabilityInwardsSurfaceLine_GetZAtL_Cannot_determine_height { + public static string MacroStabilityInwardsSurfaceLine_SetCharacteristicPointAt_Geometry_does_not_contain_point_at_0_to_assign_as_characteristic_point_1_ { get { - return ResourceManager.GetString("RingtoetsMacroStabilityInwardsSurfaceLine_GetZAtL_Cannot_determine_height", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSurfaceLine_SetCharacteristicPointAt_Geometry_does_not_conta" + + "in_point_at_0_to_assign_as_characteristic_point_1_", resourceCulture); } } /// /// Looks up a localized string similar to De profielschematisatie heeft geen geometrie.. /// - public static string RingtoetsMacroStabilityInwardsSurfaceLine_SurfaceLine_has_no_Geometry { + public static string MacroStabilityInwardsSurfaceLine_SurfaceLine_has_no_Geometry { get { - return ResourceManager.GetString("RingtoetsMacroStabilityInwardsSurfaceLine_SurfaceLine_has_no_Geometry", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSurfaceLine_SurfaceLine_has_no_Geometry", resourceCulture); } } } Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Properties/Resources.resx =================================================================== diff -u -r5579d8fdef4f553fb4ba94160825ec960b89bab9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Properties/Resources.resx (.../Resources.resx) (revision 5579d8fdef4f553fb4ba94160825ec960b89bab9) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Properties/Resources.resx (.../Resources.resx) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -120,22 +120,22 @@ Geen lagen gevonden voor de ondergrondschematisatie. - + Kan geen hoogte bepalen op het punt met de lokale coördinaat {0}, omdat de profielschematisatie verticaal loopt op dat punt. - + Een punt in de geometrie voor de profielschematisatie heeft geen waarde. - + De geometrie die opgegeven werd voor de profielschematisatie heeft geen waarde. - + {0} De lokale coördinaat moet in het bereik {1} liggen. - + De profielschematisatie heeft geen geometrie. - + Kan geen hoogte bepalen. Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Ringtoets.MacroStabilityInwards.Primitives.csproj =================================================================== diff -u -r669e99259a7cc575b5df2be2c0ea7105d9edcbcf -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Ringtoets.MacroStabilityInwards.Primitives.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.csproj) (revision 669e99259a7cc575b5df2be2c0ea7105d9edcbcf) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Ringtoets.MacroStabilityInwards.Primitives.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.csproj) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -42,7 +42,7 @@ Properties\GlobalAssembly.cs - + @@ -55,7 +55,7 @@ True - + Fisheye: Tag cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/RingtoetsMacroStabilityInwardsSurfaceLine.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsDataSynchronizationService.cs =================================================================== diff -u -rcfe30fb624bcc031454e7ff22e333386ed6ead87 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsDataSynchronizationService.cs (.../MacroStabilityInwardsDataSynchronizationService.cs) (revision cfe30fb624bcc031454e7ff22e333386ed6ead87) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsDataSynchronizationService.cs (.../MacroStabilityInwardsDataSynchronizationService.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -141,7 +141,7 @@ } /// - /// Removes a given from the + /// Removes a given from the /// and clears all data that depends on it, either directly or indirectly. /// /// The failure mechanism containing . @@ -150,7 +150,7 @@ /// All observable objects affected by this method. /// Thrown when /// or is null. - public static IEnumerable RemoveSurfaceLine(MacroStabilityInwardsFailureMechanism failureMechanism, RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + public static IEnumerable RemoveSurfaceLine(MacroStabilityInwardsFailureMechanism failureMechanism, MacroStabilityInwardsSurfaceLine surfaceLine) { if (failureMechanism == null) { @@ -175,7 +175,7 @@ } /// - /// Removes all from the + /// Removes all from the /// and clears all data that depends on it, either directly or indirectly. /// /// The failure mechanism. Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsCalculationScenarioExtensionsTest.cs =================================================================== diff -u -r5906f61fff270a7526253bea07dfecdf680898ed -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsCalculationScenarioExtensionsTest.cs (.../MacroStabilityInwardsCalculationScenarioExtensionsTest.cs) (revision 5906f61fff270a7526253bea07dfecdf680898ed) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsCalculationScenarioExtensionsTest.cs (.../MacroStabilityInwardsCalculationScenarioExtensionsTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -49,7 +49,7 @@ public void IsSurfaceLineIntersectionWithReferenceLineInSection_EmptySegmentCollection_ThrowsInvalidOperationException() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { ReferenceLineIntersectionWorldPoint = new Point2D(0.0, 0.0) }; @@ -85,7 +85,7 @@ public void IsSurfaceLineIntersectionWithReferenceLineInSection_WithoutReferenceLineIntersectionWorldPoint_ThrowsArgumentNullException() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0.0, 5.0, 0.0), @@ -120,7 +120,7 @@ public void IsSurfaceLineIntersectionWithReferenceLineInSection_SurfaceLineIntersectsReferenceline_ReturnsTrue() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { ReferenceLineIntersectionWorldPoint = new Point2D(0.0, 0.0) }; @@ -158,7 +158,7 @@ public void IsSurfaceLineIntersectionWithReferenceLineInSection_SurfaceLineDoesNotIntersectsReferenceline_ReturnsFalse() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { ReferenceLineIntersectionWorldPoint = new Point2D(0.0, 0.0) }; Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsSurfaceLineCollectionTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsSurfaceLineCollectionTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsSurfaceLineCollectionTest.cs (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -0,0 +1,105 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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 System.Linq; +using Core.Common.Base; +using NUnit.Framework; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.MacroStabilityInwards.Primitives; + +namespace Ringtoets.MacroStabilityInwards.Data.Test +{ + [TestFixture] + public class MacroStabilityInwardsSurfaceLineCollectionTest : + CustomObservableUniqueItemCollectionWithSourcePathTestFixtureBase< + ObservableUniqueItemCollectionWithSourcePath, MacroStabilityInwardsSurfaceLine> + { + protected override ObservableUniqueItemCollectionWithSourcePath CreateCollection() + { + return new MacroStabilityInwardsSurfaceLineCollection(); + } + + protected override IEnumerable UniqueElements() + { + yield return new MacroStabilityInwardsSurfaceLine + { + Name = "Name A" + }; + yield return new MacroStabilityInwardsSurfaceLine + { + Name = "Name B" + }; + } + + protected override IEnumerable SingleNonUniqueElements() + { + const string duplicateName = "Duplicate name it is"; + + yield return new MacroStabilityInwardsSurfaceLine + { + Name = duplicateName + }; + yield return new MacroStabilityInwardsSurfaceLine + { + Name = duplicateName + }; + } + + protected override void AssertSingleNonUniqueElements(ArgumentException exception, IEnumerable itemsToAdd) + { + string duplicateName = itemsToAdd.First().Name; + Assert.AreEqual($"Profielschematisaties moeten een unieke naam hebben. Gevonden dubbele elementen: {duplicateName}.", + exception.Message); + } + + protected override IEnumerable MultipleNonUniqueElements() + { + const string duplicateNameOne = "Duplicate name it is"; + const string duplicateNameTwo = "Duplicate name again"; + yield return new MacroStabilityInwardsSurfaceLine + { + Name = duplicateNameOne + }; + yield return new MacroStabilityInwardsSurfaceLine + { + Name = duplicateNameOne + }; + yield return new MacroStabilityInwardsSurfaceLine + { + Name = duplicateNameTwo + }; + yield return new MacroStabilityInwardsSurfaceLine + { + Name = duplicateNameTwo + }; + } + + protected override void AssertMultipleNonUniqueElements(ArgumentException exception, IEnumerable itemsToAdd) + { + string duplicateNameOne = itemsToAdd.First().Name; + string duplicateNameTwo = itemsToAdd.First(i => i.Name != duplicateNameOne).Name; + Assert.AreEqual("Profielschematisaties moeten een unieke naam hebben. Gevonden dubbele elementen: " + + $"{duplicateNameOne}, {duplicateNameTwo}.", exception.Message); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/Ringtoets.MacroStabilityInwards.Data.Test.csproj =================================================================== diff -u -rf6f910cf9e6c78af77bbac56f232242553e3f9de -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/Ringtoets.MacroStabilityInwards.Data.Test.csproj (.../Ringtoets.MacroStabilityInwards.Data.Test.csproj) (revision f6f910cf9e6c78af77bbac56f232242553e3f9de) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/Ringtoets.MacroStabilityInwards.Data.Test.csproj (.../Ringtoets.MacroStabilityInwards.Data.Test.csproj) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -68,7 +68,7 @@ - + Fisheye: Tag cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/RingtoetsMacroStabilityInwardsSurfaceLineCollectionTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/SoilProfileUnderSurfaceLineFactory.cs =================================================================== diff -u -r376649a985f9523e6ecac956b3abd39ed1a64369 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/SoilProfileUnderSurfaceLineFactory.cs (.../SoilProfileUnderSurfaceLineFactory.cs) (revision 376649a985f9523e6ecac956b3abd39ed1a64369) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/SoilProfileUnderSurfaceLineFactory.cs (.../SoilProfileUnderSurfaceLineFactory.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -36,7 +36,7 @@ public void Create_SoilProfile1DNull_ThrowArgumentNullException() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); // Call TestDelegate test = () => SoilProfileUnderSurfaceLineFactory.Create(null, surfaceLine); @@ -78,7 +78,7 @@ public void Create_SurfaceLineOnTopOrAboveSoilLayer_ReturnsSoilLayerPointsAsRectangle() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 4), @@ -109,7 +109,7 @@ public void Create_SurfaceLineBelowSoilLayer_ReturnsEmptyAreasCollection() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 2.0), @@ -132,7 +132,7 @@ public void Create_SurfaceLineThroughMiddleLayerButNotSplittingIt_ReturnsSoilLayerPointsAsRectangleFollowingSurfaceLine() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 3.0), @@ -168,7 +168,7 @@ public void Create_SurfaceLineThroughMiddleLayerButNotSplittingItIntersectionOnTopLevel_ReturnsSoilLayerPointsAsRectangleFollowingSurfaceLine() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 3.0), @@ -206,7 +206,7 @@ public void Create_SurfaceLineStartsBelowLayerTopButAboveBottom_ReturnsSoilLayerPointsAsRectangleFollowingSurfaceLine() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 2.0), @@ -241,7 +241,7 @@ public void Create_SurfaceLineEndsBelowLayerTopButAboveBottom_ReturnsSoilLayerPointsAsRectangleFollowingSurfaceLine() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 3.0), @@ -276,7 +276,7 @@ public void Create_SurfaceLineZigZagsThroughSoilLayer_ReturnsSoilLayerPointsSplitInMultipleAreas() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 4.0), Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/StochasticSoilModelExtensionsTest.cs =================================================================== diff -u -rcfe30fb624bcc031454e7ff22e333386ed6ead87 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/StochasticSoilModelExtensionsTest.cs (.../StochasticSoilModelExtensionsTest.cs) (revision cfe30fb624bcc031454e7ff22e333386ed6ead87) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/StochasticSoilModelExtensionsTest.cs (.../StochasticSoilModelExtensionsTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -33,7 +33,7 @@ public void IntersectsWithSurfaceLineGeometry_SoilModelNull_ThrowArgumentNullException() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(3.0, 5.0, 0.0), @@ -81,7 +81,7 @@ new Point2D(5.0, 0.0) }); - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(3.0, 5.0, 0.0), @@ -107,7 +107,7 @@ new Point2D(5.0, 0.0) }); - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0.0, 1.0, 0.0), Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/TestMacroStabilityInwardsFailureMechanismTest.cs =================================================================== diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/TestMacroStabilityInwardsFailureMechanismTest.cs (.../TestMacroStabilityInwardsFailureMechanismTest.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/TestMacroStabilityInwardsFailureMechanismTest.cs (.../TestMacroStabilityInwardsFailureMechanismTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -51,11 +51,11 @@ // Assert Assert.AreEqual(24, failureMechanism.Contribution); - RingtoetsMacroStabilityInwardsSurfaceLineCollection surfaceLines = failureMechanism.SurfaceLines; + MacroStabilityInwardsSurfaceLineCollection surfaceLines = failureMechanism.SurfaceLines; Assert.AreEqual("path/to/surfaceLines", surfaceLines.SourcePath); Assert.AreEqual(1, surfaceLines.Count); - RingtoetsMacroStabilityInwardsSurfaceLine[] surfaceLineArray = surfaceLines.ToArray(); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = surfaceLineArray[0]; + MacroStabilityInwardsSurfaceLine[] surfaceLineArray = surfaceLines.ToArray(); + MacroStabilityInwardsSurfaceLine surfaceLine = surfaceLineArray[0]; Assert.AreEqual(new Point2D(0.0, 0.0), surfaceLine.ReferenceLineIntersectionWorldPoint); CollectionAssert.IsNotEmpty(surfaceLine.LocalGeometry); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsCalculationScenarioFactory.cs =================================================================== diff -u -rd47809e3a8fadff2be5b10056b79b16dc27eeca2 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsCalculationScenarioFactory.cs (.../MacroStabilityInwardsCalculationScenarioFactory.cs) (revision d47809e3a8fadff2be5b10056b79b16dc27eeca2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsCalculationScenarioFactory.cs (.../MacroStabilityInwardsCalculationScenarioFactory.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -96,7 +96,7 @@ { throw new ArgumentNullException(nameof(section)); } - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); Point2D p = section.Points.First(); surfaceLine.SetGeometry(new[] { @@ -147,7 +147,7 @@ } }, SoilProfileType.SoilProfile1D, 0) }; - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); var firstCharacteristicPointLocation = new Point3D(0.2, 0.0, bottom + 3 * top / 4); var secondCharacteristicPointLocation = new Point3D(0.3, 0.0, bottom + 2 * top / 4); var thirdCharacteristicPointLocation = new Point3D(0.4, 0.0, bottom + top / 4); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsInputFactory.cs =================================================================== diff -u -rd47809e3a8fadff2be5b10056b79b16dc27eeca2 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsInputFactory.cs (.../MacroStabilityInwardsInputFactory.cs) (revision d47809e3a8fadff2be5b10056b79b16dc27eeca2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsInputFactory.cs (.../MacroStabilityInwardsInputFactory.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -40,7 +40,7 @@ double thicknessAquiferLayer = 1.0, double thicknessCoverageLayer = 2.0) { - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, thicknessCoverageLayer), @@ -75,7 +75,7 @@ /// A new . public static MacroStabilityInwardsInput CreateInputWithAquifer(double thicknessAquiferLayer = 1.0) { - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 0.0), @@ -106,7 +106,7 @@ /// A new . public static MacroStabilityInwardsInput CreateInputWithSingleAquiferLayerAboveSurfaceLine(double deltaAboveSurfaceLine) { - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); const double surfaceLineTopLevel = 2.0; surfaceLine.SetGeometry(new[] { @@ -146,7 +146,7 @@ /// A new . public static MacroStabilityInwardsInput CreateInputWithMultipleAquiferLayersUnderSurfaceLine(out double expectedThickness) { - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 3.3), Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsTestDataGenerator.cs =================================================================== diff -u -rcfe30fb624bcc031454e7ff22e333386ed6ead87 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsTestDataGenerator.cs (.../MacroStabilityInwardsTestDataGenerator.cs) (revision cfe30fb624bcc031454e7ff22e333386ed6ead87) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsTestDataGenerator.cs (.../MacroStabilityInwardsTestDataGenerator.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -127,7 +127,7 @@ /// A . public static MacroStabilityInwardsCalculationScenario GetMacroStabilityInwardsCalculationScenario() { - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { ReferenceLineIntersectionWorldPoint = new Point2D(0, 5), Name = "PK001_0001" @@ -206,7 +206,7 @@ public static void ConfigureFailureMechanismWithAllCalculationConfigurations(MacroStabilityInwardsFailureMechanism failureMechanism, HydraulicBoundaryLocation hydraulicBoundaryLocation) { - var surfaceLine1 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine1 = new MacroStabilityInwardsSurfaceLine { ReferenceLineIntersectionWorldPoint = new Point2D(0, 5), Name = "Line A" @@ -216,7 +216,7 @@ new Point3D(0, 0, 0), new Point3D(0, 10, 0) }); - var surfaceLine2 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine2 = new MacroStabilityInwardsSurfaceLine { ReferenceLineIntersectionWorldPoint = new Point2D(10, 5), Name = "Line B" Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsTestDataGeneratorHelper.cs =================================================================== diff -u -r553ea9461421deb6f14aaedd004f113868c5214b -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsTestDataGeneratorHelper.cs (.../MacroStabilityInwardsTestDataGeneratorHelper.cs) (revision 553ea9461421deb6f14aaedd004f113868c5214b) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsTestDataGeneratorHelper.cs (.../MacroStabilityInwardsTestDataGeneratorHelper.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -70,7 +70,7 @@ } /// - /// Asserts sthat the contains . + /// Asserts sthat the contains . /// /// The failure mechanism to assert. public static void AssertHasSurfaceLines(MacroStabilityInwardsFailureMechanism failureMechanism) Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/TestMacroStabilityInwardsFailureMechanism.cs =================================================================== diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/TestMacroStabilityInwardsFailureMechanism.cs (.../TestMacroStabilityInwardsFailureMechanism.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/TestMacroStabilityInwardsFailureMechanism.cs (.../TestMacroStabilityInwardsFailureMechanism.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -45,7 +45,7 @@ /// A new instance of . public static TestMacroStabilityInwardsFailureMechanism GetFailureMechanismWithSurfaceLinesAndStochasticSoilModels() { - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { ReferenceLineIntersectionWorldPoint = new Point2D(0.0, 0.0) }; Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsChartDataFactoryTest.cs =================================================================== diff -u -rd47809e3a8fadff2be5b10056b79b16dc27eeca2 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsChartDataFactoryTest.cs (.../MacroStabilityInwardsChartDataFactoryTest.cs) (revision d47809e3a8fadff2be5b10056b79b16dc27eeca2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsChartDataFactoryTest.cs (.../MacroStabilityInwardsChartDataFactoryTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -135,7 +135,7 @@ [TestCase("Random", 5)] public void CreateSoilLayerChartData_ValidSoilProfileAndSoilLayerIndex_ReturnsEmptyChartDataCollectionWithDefaultStyling(string name, int soilLayerIndex) { - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 4), @@ -182,7 +182,7 @@ { // Setup var chartData = new ChartLineData("test name"); - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { Name = "surface line name" }; Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsChartDataPointsFactoryTest.cs =================================================================== diff -u -r6483bd7c2aef66cc8ae0879ba2b2b261aa0cb32a -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsChartDataPointsFactoryTest.cs (.../MacroStabilityInwardsChartDataPointsFactoryTest.cs) (revision 6483bd7c2aef66cc8ae0879ba2b2b261aa0cb32a) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsChartDataPointsFactoryTest.cs (.../MacroStabilityInwardsChartDataPointsFactoryTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -46,7 +46,7 @@ public void CreateSurfaceLinePoints_GivenSurfaceLine_ReturnsSurfaceLinePointsArray() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLinePoints(surfaceLine); @@ -69,7 +69,7 @@ public void CreateSurfaceLevelOutsidePoint_SurfaceLevelOutsideNull_ReturnsEmptyPointsArray() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLevelOutsidePoint(surfaceLine); @@ -83,7 +83,7 @@ { // Setup var surfaceLevelOutside = new Point3D(1.2, 2.3, 4.0); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); surfaceLine.SetSurfaceLevelOutsideAt(surfaceLevelOutside); @@ -108,7 +108,7 @@ public void CreateDikeToeAtRiverPoint_SurfaceLevelOutsideNull_ReturnsEmptyPointsArray() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeToeAtRiverPoint(surfaceLine); @@ -122,7 +122,7 @@ { // Setup var dikeToeAtRiver = new Point3D(1.2, 2.3, 4.0); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); surfaceLine.SetDikeToeAtRiverAt(dikeToeAtRiver); @@ -147,7 +147,7 @@ public void CreateTrafficLoadOutsidePoint_SurfaceLevelOutsideNull_ReturnsEmptyPointsArray() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateTrafficLoadOutsidePoint(surfaceLine); @@ -161,7 +161,7 @@ { // Setup var trafficLoadOutside = new Point3D(1.2, 2.3, 4.0); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); surfaceLine.SetTrafficLoadOutsideAt(trafficLoadOutside); @@ -186,7 +186,7 @@ public void CreateTrafficLoadInsidePoint_TrafficLoadInsideNull_ReturnsEmptyPointsArray() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateTrafficLoadInsidePoint(surfaceLine); @@ -200,7 +200,7 @@ { // Setup var trafficLoadInside = new Point3D(1.2, 2.3, 4.0); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); surfaceLine.SetTrafficLoadInsideAt(trafficLoadInside); @@ -225,7 +225,7 @@ public void CreateDikeTopAtPolderPoint_DikeTopAtPolderNull_ReturnsEmptyPointsArray() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeTopAtPolderPoint(surfaceLine); @@ -239,7 +239,7 @@ { // Setup var dikeTopAtPolder = new Point3D(1.2, 2.3, 4.0); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); surfaceLine.SetDikeTopAtPolderAt(dikeTopAtPolder); @@ -264,7 +264,7 @@ public void CreateShoulderBaseInsidePoint_ShoulderBaseInsideNull_ReturnsEmptyPointsArray() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateShoulderBaseInsidePoint(surfaceLine); @@ -278,7 +278,7 @@ { // Setup var shoulderBaseInside = new Point3D(1.2, 2.3, 4.0); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); surfaceLine.SetShoulderBaseInsideAt(shoulderBaseInside); @@ -303,7 +303,7 @@ public void CreateShoulderTopInsidePoint_ShoulderTopInsideNull_ReturnsEmptyPointsArray() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateShoulderTopInsidePoint(surfaceLine); @@ -317,7 +317,7 @@ { // Setup var shoulderTopInside = new Point3D(1.2, 2.3, 4.0); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); surfaceLine.SetShoulderTopInsideAt(shoulderTopInside); @@ -342,7 +342,7 @@ public void CreateDikeToeAtPolderPoint_DikeToeAtPolderNull_ReturnsEmptyPointsArray() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeToeAtPolderPoint(surfaceLine); @@ -356,7 +356,7 @@ { // Setup var dikeToeAtPolder = new Point3D(1.2, 2.3, 4.0); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); surfaceLine.SetDikeToeAtPolderAt(dikeToeAtPolder); @@ -381,7 +381,7 @@ public void CreateDitchDikeSidePoint_DitchDikeSideNull_ReturnsEmptyPointsArray() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDitchDikeSidePoint(surfaceLine); @@ -395,7 +395,7 @@ { // Setup var ditchDikeSide = new Point3D(1.2, 2.3, 4.0); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); surfaceLine.SetDitchDikeSideAt(ditchDikeSide); @@ -420,7 +420,7 @@ public void CreateBottomDitchDikeSidePoint_BottomDitchDikeSideNull_ReturnsEmptyPointsArray() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateBottomDitchDikeSidePoint(surfaceLine); @@ -434,7 +434,7 @@ { // Setup var bottomDitchDikeSide = new Point3D(1.2, 2.3, 4.0); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); surfaceLine.SetBottomDitchDikeSideAt(bottomDitchDikeSide); @@ -459,7 +459,7 @@ public void CreateBottomDitchPolderSidePoint_BottomDitchPolderSideNull_ReturnsEmptyPointsArray() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateBottomDitchPolderSidePoint(surfaceLine); @@ -473,7 +473,7 @@ { // Setup var bottomDitchPolderSide = new Point3D(1.2, 2.3, 4.0); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); surfaceLine.SetBottomDitchPolderSideAt(bottomDitchPolderSide); @@ -498,7 +498,7 @@ public void CreateDitchPolderSidePoint_DitchPolderSideNull_ReturnsEmptyPointsArray() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDitchPolderSidePoint(surfaceLine); @@ -512,7 +512,7 @@ { // Setup var ditchPolderSide = new Point3D(1.2, 2.3, 4.0); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); surfaceLine.SetDitchPolderSideAt(ditchPolderSide); @@ -537,7 +537,7 @@ public void CreateSurfaceLevelInsidePoint_SurfaceLevelInsideNull_ReturnsEmptyPointsArray() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLevelInsidePoint(surfaceLine); @@ -551,7 +551,7 @@ { // Setup var surfaceLevelInside = new Point3D(1.2, 2.3, 4.0); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); surfaceLine.SetSurfaceLevelInsideAt(surfaceLevelInside); @@ -570,7 +570,7 @@ { new MacroStabilityInwardsSoilLayer1D(3.2) }, SoilProfileType.SoilProfile1D, 0); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call IEnumerable areas = MacroStabilityInwardsChartDataPointsFactory.CreateSoilLayerAreas(null, soilProfile, surfaceLine); @@ -584,7 +584,7 @@ { // Setup var soilLayer = new MacroStabilityInwardsSoilLayer1D(3.2); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call IEnumerable areas = MacroStabilityInwardsChartDataPointsFactory.CreateSoilLayerAreas(soilLayer, null, surfaceLine); @@ -614,7 +614,7 @@ public void CreateSoilLayerAreas_SurfaceLineOnTopOrAboveSoilLayer_ReturnsSoilLayerPointsAsRectangle() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 4), @@ -645,7 +645,7 @@ public void CreateSoilLayerAreas_SurfaceLineBelowSoilLayer_ReturnsEmptyAreasCollection() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 2.0), @@ -668,7 +668,7 @@ public void CreateSoilLayerAreas_SurfaceLineThroughMiddleLayerButNotSplittingIt_ReturnsSoilLayerPointsAsRectangleFollowingSurfaceLine() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 3.0), @@ -704,7 +704,7 @@ public void CreateSoilLayerAreas_SurfaceLineThroughMiddleLayerButNotSplittingItIntersectionOnTopLevel_ReturnsSoilLayerPointsAsRectangleFollowingSurfaceLine() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 3.0), @@ -742,7 +742,7 @@ public void CreateSoilLayerAreas_SurfaceLineStartsBelowLayerTopButAboveBottom_ReturnsSoilLayerPointsAsRectangleFollowingSurfaceLine() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 2.0), @@ -777,7 +777,7 @@ public void CreateSoilLayerAreas_SurfaceLineEndsBelowLayerTopButAboveBottom_ReturnsSoilLayerPointsAsRectangleFollowingSurfaceLine() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 3.0), @@ -812,7 +812,7 @@ public void CreateSoilLayerAreas_SurfaceLineZigZagsThroughSoilLayer_ReturnsSoilLayerPointsSplitInMultipleAreas() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 4.0), @@ -853,7 +853,7 @@ CollectionAssert.AreEqual(points, chartPoints); } - private static void AssertEqualLocalPointCollection(Point3D point, RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, IEnumerable chartPoints) + private static void AssertEqualLocalPointCollection(Point3D point, MacroStabilityInwardsSurfaceLine surfaceLine, IEnumerable chartPoints) { Point3D first = surfaceLine.Points.First(); Point3D last = surfaceLine.Points.Last(); @@ -867,9 +867,9 @@ }, chartPoints); } - private static RingtoetsMacroStabilityInwardsSurfaceLine GetSurfaceLineWithGeometry() + private static MacroStabilityInwardsSurfaceLine GetSurfaceLineWithGeometry() { - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsMapDataFeaturesFactoryTest.cs =================================================================== diff -u -rcfe30fb624bcc031454e7ff22e333386ed6ead87 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsMapDataFeaturesFactoryTest.cs (.../MacroStabilityInwardsMapDataFeaturesFactoryTest.cs) (revision cfe30fb624bcc031454e7ff22e333386ed6ead87) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsMapDataFeaturesFactoryTest.cs (.../MacroStabilityInwardsMapDataFeaturesFactoryTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -50,7 +50,7 @@ public void CreateSurfaceLineFeatures_NoSurfaceLines_ReturnsEmptyFeaturesArray() { // Call - MapFeature[] features = MacroStabilityInwardsMapDataFeaturesFactory.CreateSurfaceLineFeatures(new RingtoetsMacroStabilityInwardsSurfaceLine[0]); + MapFeature[] features = MacroStabilityInwardsMapDataFeaturesFactory.CreateSurfaceLineFeatures(new MacroStabilityInwardsSurfaceLine[0]); // Assert CollectionAssert.IsEmpty(features); @@ -72,11 +72,11 @@ }; var surfaceLines = new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = "Surface line 1" }, - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = "Surface line 2" } Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/MacroStabilityInwardsCalculationConfigurationHelperTest.cs =================================================================== diff -u -rd47809e3a8fadff2be5b10056b79b16dc27eeca2 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/MacroStabilityInwardsCalculationConfigurationHelperTest.cs (.../MacroStabilityInwardsCalculationConfigurationHelperTest.cs) (revision d47809e3a8fadff2be5b10056b79b16dc27eeca2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/MacroStabilityInwardsCalculationConfigurationHelperTest.cs (.../MacroStabilityInwardsCalculationConfigurationHelperTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -76,7 +76,7 @@ soilModel }; - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(3.0, 5.0, 0.0), @@ -149,7 +149,7 @@ public void GetStochasticSoilModelsForSurfaceLine_NoSoilModels_ReturnEmpty() { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(3.0, 5.0, 0.0), @@ -182,7 +182,7 @@ soilModel }; - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(3.0, 5.0, 0.0), @@ -238,7 +238,7 @@ soilModel }; - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0.0, 1.0, 0.0), @@ -304,7 +304,7 @@ soilModel2 }; - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(5.0, y, 0.0), @@ -349,7 +349,7 @@ { // Call TestDelegate test = () => MacroStabilityInwardsCalculationConfigurationHelper.GenerateCalculationItemsStructure( - Enumerable.Empty(), + Enumerable.Empty(), null, new GeneralMacroStabilityInwardsInput()); @@ -363,7 +363,7 @@ { // Call TestDelegate test = () => MacroStabilityInwardsCalculationConfigurationHelper.GenerateCalculationItemsStructure( - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), null); @@ -381,21 +381,21 @@ const string testName3 = "group3"; const string testName4 = "group4"; - var surfaceLines = new List + var surfaceLines = new List { - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = testName1 }, - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = testName2 }, - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = testName3 }, - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = testName4 } @@ -463,15 +463,15 @@ soilModel }; - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(3.0, 5.0, 0.0), new Point3D(3.0, 0.0, 1.0), new Point3D(3.0, -5.0, 0.0) }); - RingtoetsMacroStabilityInwardsSurfaceLine[] surfaceLines = + MacroStabilityInwardsSurfaceLine[] surfaceLines = { surfaceLine }; @@ -522,7 +522,7 @@ }; const string testName = "testName"; - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { Name = testName }; @@ -533,7 +533,7 @@ new Point3D(3.0, -5.0, 0.0) }); - RingtoetsMacroStabilityInwardsSurfaceLine[] surfaceLines = + MacroStabilityInwardsSurfaceLine[] surfaceLines = { surfaceLine }; @@ -596,7 +596,7 @@ }; const string testName = "testName"; - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { Name = testName }; @@ -607,7 +607,7 @@ new Point3D(5.0, 1.0, 0.0) }); - RingtoetsMacroStabilityInwardsSurfaceLine[] surfaceLines = + MacroStabilityInwardsSurfaceLine[] surfaceLines = { surfaceLine }; @@ -682,7 +682,7 @@ soilModel2 }; - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(5.0, y, 0.0), @@ -778,7 +778,7 @@ const string surfaceLineName1 = "surface line 1"; const string surfaceLineName2 = "surface line 2"; - var surfaceLine1 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine1 = new MacroStabilityInwardsSurfaceLine { Name = surfaceLineName1 }; @@ -787,7 +787,7 @@ new Point3D(2.5, y, 1.0), new Point3D(0.0, y, 0.0) }); - var surfaceLine2 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine2 = new MacroStabilityInwardsSurfaceLine { Name = surfaceLineName2 }; @@ -899,7 +899,7 @@ const string surfaceLineName1 = "surface line 1"; const string surfaceLineName2 = "surface line 2"; - var surfaceLine1 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine1 = new MacroStabilityInwardsSurfaceLine { Name = surfaceLineName1 }; @@ -908,7 +908,7 @@ new Point3D(2.5, y, 1.0), new Point3D(0.0, y, 0.0) }); - var surfaceLine2 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine2 = new MacroStabilityInwardsSurfaceLine { Name = surfaceLineName2 }; @@ -999,7 +999,7 @@ soilModel }; - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { Name = "Surface Line" }; @@ -1082,7 +1082,7 @@ soilModel }; - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { Name = "Surface Line" }; Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/MacroStabilityInwardsSurfaceLineSelectionDialogTest.cs =================================================================== diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/MacroStabilityInwardsSurfaceLineSelectionDialogTest.cs (.../MacroStabilityInwardsSurfaceLineSelectionDialogTest.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/MacroStabilityInwardsSurfaceLineSelectionDialogTest.cs (.../MacroStabilityInwardsSurfaceLineSelectionDialogTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -40,7 +40,7 @@ public void Constructor_WithoutParent_ThrowsArgumentNullException() { // Call - TestDelegate test = () => new MacroStabilityInwardsSurfaceLineSelectionDialog(null, Enumerable.Empty()); + TestDelegate test = () => new MacroStabilityInwardsSurfaceLineSelectionDialog(null, Enumerable.Empty()); // Assert string parameter = Assert.Throws(test).ParamName; @@ -69,10 +69,10 @@ using (var viewParent = new Form()) { // Call - using (var dialog = new MacroStabilityInwardsSurfaceLineSelectionDialog(viewParent, Enumerable.Empty())) + using (var dialog = new MacroStabilityInwardsSurfaceLineSelectionDialog(viewParent, Enumerable.Empty())) { // Assert - Assert.IsInstanceOf>(dialog); + Assert.IsInstanceOf>(dialog); Assert.IsEmpty(dialog.SelectedItems); Assert.AreEqual("Selecteer profielschematisaties", dialog.Text); } @@ -84,7 +84,7 @@ { // Setup & Call using (var viewParent = new Form()) - using (var dialog = new MacroStabilityInwardsSurfaceLineSelectionDialog(viewParent, Enumerable.Empty())) + using (var dialog = new MacroStabilityInwardsSurfaceLineSelectionDialog(viewParent, Enumerable.Empty())) { dialog.Show(); @@ -115,7 +115,7 @@ { // Setup const string testname = "testName"; - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { Name = testname }; Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsCalculationGroupContextTest.cs =================================================================== diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsCalculationGroupContextTest.cs (.../MacroStabilityInwardsCalculationGroupContextTest.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsCalculationGroupContextTest.cs (.../MacroStabilityInwardsCalculationGroupContextTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -46,7 +46,7 @@ var calculationGroup = new CalculationGroup(); var surfaceLines = new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine() + new MacroStabilityInwardsSurfaceLine() }; var soilModels = new StochasticSoilModel[] { Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsCalculationScenarioContextTest.cs =================================================================== diff -u -rcfe30fb624bcc031454e7ff22e333386ed6ead87 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsCalculationScenarioContextTest.cs (.../MacroStabilityInwardsCalculationScenarioContextTest.cs) (revision cfe30fb624bcc031454e7ff22e333386ed6ead87) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsCalculationScenarioContextTest.cs (.../MacroStabilityInwardsCalculationScenarioContextTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -44,7 +44,7 @@ var surfaceLines = new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine() + new MacroStabilityInwardsSurfaceLine() }; var soilModels = new[] { Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsContextTest.cs =================================================================== diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsContextTest.cs (.../MacroStabilityInwardsContextTest.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsContextTest.cs (.../MacroStabilityInwardsContextTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -45,10 +45,10 @@ var assessmentSectionStub = mocks.Stub(); mocks.ReplayAll(); - RingtoetsMacroStabilityInwardsSurfaceLine[] surfaceLines = + MacroStabilityInwardsSurfaceLine[] surfaceLines = { - new RingtoetsMacroStabilityInwardsSurfaceLine(), - new RingtoetsMacroStabilityInwardsSurfaceLine() + new MacroStabilityInwardsSurfaceLine(), + new MacroStabilityInwardsSurfaceLine() }; var soilModels = new[] @@ -108,7 +108,7 @@ // Call TestDelegate call = () => new SimpleMacroStabilityInwardsContext(new ObservableObject(), - Enumerable.Empty(), + Enumerable.Empty(), null, new MacroStabilityInwardsFailureMechanism(), assessmentSectionStub); @@ -129,7 +129,7 @@ // Call TestDelegate call = () => new SimpleMacroStabilityInwardsContext(new ObservableObject(), - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), null, assessmentSectionStub); @@ -145,7 +145,7 @@ { // Call TestDelegate call = () => new SimpleMacroStabilityInwardsContext(new ObservableObject(), - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), new MacroStabilityInwardsFailureMechanism(), null); @@ -157,7 +157,7 @@ private class SimpleMacroStabilityInwardsContext : MacroStabilityInwardsContext where T : IObservable { - public SimpleMacroStabilityInwardsContext(T target, IEnumerable surfaceLines, IEnumerable stochasticSoilModels, MacroStabilityInwardsFailureMechanism macroStabilityInwardsFailureMechanism, IAssessmentSection assessmentSection) + public SimpleMacroStabilityInwardsContext(T target, IEnumerable surfaceLines, IEnumerable stochasticSoilModels, MacroStabilityInwardsFailureMechanism macroStabilityInwardsFailureMechanism, IAssessmentSection assessmentSection) : base(target, surfaceLines, stochasticSoilModels, macroStabilityInwardsFailureMechanism, assessmentSection) {} } Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsInputContextTest.cs =================================================================== diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsInputContextTest.cs (.../MacroStabilityInwardsInputContextTest.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsInputContextTest.cs (.../MacroStabilityInwardsInputContextTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -44,7 +44,7 @@ var calculation = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()); var surfaceLines = new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine() + new MacroStabilityInwardsSurfaceLine() }; var stochasticSoilModels = new[] { @@ -78,7 +78,7 @@ var calculationInput = new MacroStabilityInwardsInput(new GeneralMacroStabilityInwardsInput()); var surfaceLines = new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine() + new MacroStabilityInwardsSurfaceLine() }; var stochasticSoilModels = new[] { Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsSurfaceLinesContextTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsSurfaceLinesContextTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsSurfaceLinesContextTest.cs (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -0,0 +1,91 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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 Core.Common.Controls.PresentationObjects; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.MacroStabilityInwards.Forms.PresentationObjects; + +namespace Ringtoets.MacroStabilityInwards.Forms.Test.PresentationObjects +{ + [TestFixture] + public class MacroStabilityInwardsSurfaceLinesContextTest + { + [Test] + public void ParameteredConstructor_DefaultValues() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + + // Call + var context = new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection); + + // Assert + Assert.IsInstanceOf>(context); + Assert.AreSame(surfaceLines, context.WrappedData); + Assert.AreSame(assessmentSection, context.AssessmentSection); + mocks.VerifyAll(); + } + + [Test] + public void ParameteredConstructor_AssessmentSectionNull_ThrowsArgumentNullException() + { + // Setup + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + + // Call + TestDelegate test = () => new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, null); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("assessmentSection", exception.ParamName); + } + + [Test] + public void ParameteredConstructor_FailureMechanismNull_ThrowsArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + + // Call + TestDelegate call = () => new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, null, assessmentSection); + + // Assert + string paramName = Assert.Throws(call).ParamName; + Assert.AreEqual("failureMechanism", paramName); + mocks.VerifyAll(); + } + } +} \ No newline at end of file Fisheye: Tag cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/RingtoetsMacroStabilityInwardsSurfaceLinesContextTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsInputContextPropertiesTest.cs =================================================================== diff -u -rd47809e3a8fadff2be5b10056b79b16dc27eeca2 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsInputContextPropertiesTest.cs (.../MacroStabilityInwardsInputContextPropertiesTest.cs) (revision d47809e3a8fadff2be5b10056b79b16dc27eeca2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsInputContextPropertiesTest.cs (.../MacroStabilityInwardsInputContextPropertiesTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -89,7 +89,7 @@ var context = new MacroStabilityInwardsInputContext(inputParameters, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -118,7 +118,7 @@ var context = new MacroStabilityInwardsInputContext(inputParameters, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -149,7 +149,7 @@ // Call var context = new MacroStabilityInwardsInputContext(inputParameters, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -232,7 +232,7 @@ var context = new MacroStabilityInwardsInputContext(inputParameters, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -292,7 +292,7 @@ var random = new Random(22); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = ValidSurfaceLine(0.0, 4.0); + MacroStabilityInwardsSurfaceLine surfaceLine = ValidSurfaceLine(0.0, 4.0); var stochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { SoilProfile = new MacroStabilityInwardsSoilProfile1D(string.Empty, random.NextDouble(), new[] @@ -322,7 +322,7 @@ var context = new MacroStabilityInwardsInputContext(inputParameters, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -356,7 +356,7 @@ var context = new MacroStabilityInwardsInputContext(inputParameters, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -367,7 +367,7 @@ const double assessmentLevel = 0.36; const double entryPointL = 0.12; const double exitPointL = 0.44; - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = ValidSurfaceLine(0.0, 4.0); + MacroStabilityInwardsSurfaceLine surfaceLine = ValidSurfaceLine(0.0, 4.0); StochasticSoilModel soilModel = ValidStochasticSoilModel(0.0, 4.0); StochasticSoilProfile soilProfile = soilModel.StochasticSoilProfiles.First(); var dampingFactorExit = new LogNormalDistributionDesignVariable( @@ -402,7 +402,7 @@ public void SurfaceLine_SetValidValue_SetsValueAndUpdatesObservers() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine newSurfaceLine = ValidSurfaceLine(0.0, 4.0); + MacroStabilityInwardsSurfaceLine newSurfaceLine = ValidSurfaceLine(0.0, 4.0); var calculation = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()); // Call & Assert @@ -477,7 +477,7 @@ var context = new MacroStabilityInwardsInputContext(calculationItem.InputParameters, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -517,7 +517,7 @@ var context = new MacroStabilityInwardsInputContext(calculationItem.InputParameters, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -557,7 +557,7 @@ var context = new MacroStabilityInwardsInputContext(inputParameters, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -607,7 +607,7 @@ var context = new MacroStabilityInwardsInputContext(inputParameters, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -650,7 +650,7 @@ var context = new MacroStabilityInwardsInputContext(inputParameters, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -697,12 +697,12 @@ var context = new MacroStabilityInwardsInputContext(inputParameters, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); - RingtoetsMacroStabilityInwardsSurfaceLine newSurfaceLine = ValidSurfaceLine(0, 2); + MacroStabilityInwardsSurfaceLine newSurfaceLine = ValidSurfaceLine(0, 2); var handler = new CalculationInputSetPropertyValueAfterConfirmationParameterTester(new IObservable[0]); @@ -731,7 +731,7 @@ var handler = mocks.Stub(); mocks.ReplayAll(); - RingtoetsMacroStabilityInwardsSurfaceLine testSurfaceLine = ValidSurfaceLine(0, 2); + MacroStabilityInwardsSurfaceLine testSurfaceLine = ValidSurfaceLine(0, 2); var stochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { SoilProfile = new TestMacroStabilityInwardsSoilProfile() @@ -750,7 +750,7 @@ }; var context = new MacroStabilityInwardsInputContext(inputParameters, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), new[] { stochasticSoilModel @@ -798,15 +798,15 @@ var context = new MacroStabilityInwardsInputContext(inputParameters, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), new[] { stochasticSoilModel }, failureMechanism, assessmentSection); - RingtoetsMacroStabilityInwardsSurfaceLine newSurfaceLine = ValidSurfaceLine(0, 2); + MacroStabilityInwardsSurfaceLine newSurfaceLine = ValidSurfaceLine(0, 2); var handler = new CalculationInputSetPropertyValueAfterConfirmationParameterTester(new IObservable[0]); @@ -831,7 +831,7 @@ observable.Expect(o => o.NotifyObservers()); mocks.ReplayAll(); - RingtoetsMacroStabilityInwardsSurfaceLine testSurfaceLine = ValidSurfaceLine(0, 2); + MacroStabilityInwardsSurfaceLine testSurfaceLine = ValidSurfaceLine(0, 2); var stochasticSoilProfile1 = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { SoilProfile = new TestMacroStabilityInwardsSoilProfile() @@ -857,7 +857,7 @@ var context = new MacroStabilityInwardsInputContext(inputParameters, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -878,7 +878,7 @@ } [Test] - public void GetAvailableSurfaceLines_Always_ReturnAllRingtoetsMacroStabilityInwardsSurfaceLines() + public void GetAvailableSurfaceLines_Always_ReturnAllMacroStabilityInwardsSurfaceLines() { // Setup var mocks = new MockRepository(); @@ -894,7 +894,7 @@ var properties = new MacroStabilityInwardsInputContextProperties(context, handler); // Call - IEnumerable surfaceLines = properties.GetAvailableSurfaceLines(); + IEnumerable surfaceLines = properties.GetAvailableSurfaceLines(); // Assert Assert.AreSame(context.AvailableMacroStabilityInwardsSurfaceLines, surfaceLines); @@ -937,7 +937,7 @@ var handler = mocks.Stub(); mocks.ReplayAll(); - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 0), @@ -1220,7 +1220,7 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = ValidSurfaceLine(0.0, 4.0); + MacroStabilityInwardsSurfaceLine surfaceLine = ValidSurfaceLine(0.0, 4.0); surfaceLine.ReferenceLineIntersectionWorldPoint = new Point2D(0.0, 0.0); var calculation = new MacroStabilityInwardsCalculationScenario(failureMechanism.GeneralInput) { @@ -1274,7 +1274,7 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = ValidSurfaceLine(0.0, 4.0); + MacroStabilityInwardsSurfaceLine surfaceLine = ValidSurfaceLine(0.0, 4.0); surfaceLine.ReferenceLineIntersectionWorldPoint = new Point2D(0, 0); var calculation = new MacroStabilityInwardsCalculationScenario(failureMechanism.GeneralInput) { @@ -1288,7 +1288,7 @@ failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - RingtoetsMacroStabilityInwardsSurfaceLine newSurfaceLine = ValidSurfaceLine(0.0, 5.0); + MacroStabilityInwardsSurfaceLine newSurfaceLine = ValidSurfaceLine(0.0, 5.0); newSurfaceLine.ReferenceLineIntersectionWorldPoint = new Point2D(0, 190); var handler = new CalculationInputSetPropertyValueAfterConfirmationParameterTester(new[] @@ -1342,7 +1342,7 @@ }; var context = new MacroStabilityInwardsInputContext(calculation.InputParameters, calculation, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -1369,7 +1369,7 @@ var calculation = new MacroStabilityInwardsCalculationScenario(failureMechanism.GeneralInput); var context = new MacroStabilityInwardsInputContext(calculation.InputParameters, calculation, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -1405,7 +1405,7 @@ }; var context = new MacroStabilityInwardsInputContext(calculation.InputParameters, calculation, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -1432,7 +1432,7 @@ var calculation = new MacroStabilityInwardsCalculationScenario(failureMechanism.GeneralInput); var context = new MacroStabilityInwardsInputContext(calculation.InputParameters, calculation, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -1462,7 +1462,7 @@ var context = new MacroStabilityInwardsInputContext(inputParameters, calculation, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -1494,9 +1494,9 @@ return stochasticSoilModel; } - private static RingtoetsMacroStabilityInwardsSurfaceLine ValidSurfaceLine(double xMin, double xMax) + private static MacroStabilityInwardsSurfaceLine ValidSurfaceLine(double xMin, double xMax) { - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(xMin, 0.0, 0.0), Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsSurfaceLineCollectionPropertiesTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsSurfaceLineCollectionPropertiesTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsSurfaceLineCollectionPropertiesTest.cs (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -0,0 +1,88 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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.ComponentModel; +using System.Linq; +using Core.Common.Gui.PropertyBag; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.MacroStabilityInwards.Forms.PropertyClasses; +using Ringtoets.MacroStabilityInwards.Primitives; + +namespace Ringtoets.MacroStabilityInwards.Forms.Test.PropertyClasses +{ + [TestFixture] + public class MacroStabilityInwardsSurfaceLineCollectionPropertiesTest + { + [Test] + public void Constructor_WithoutCollection_ThrowsArgumentNullException() + { + // Call + TestDelegate test = () => new MacroStabilityInwardsSurfaceLineCollectionProperties(null); + + // Assert + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("collection", paramName); + } + + [Test] + public void Constructor_WithData_ReturnExpectedValues() + { + // Setup + const string someFilePath = "location/to/a/file"; + var collection = new MacroStabilityInwardsSurfaceLineCollection(); + collection.AddRange(Enumerable.Empty(), someFilePath); + + // Call + var properties = new MacroStabilityInwardsSurfaceLineCollectionProperties(collection); + + // Assert + Assert.IsInstanceOf>(properties); + Assert.AreSame(collection, properties.Data); + Assert.AreEqual(someFilePath, properties.SourcePath); + } + + [Test] + public void Constructor_WithData_PropertiesHaveExpectedAttributesValues() + { + // Setup + var collection = new MacroStabilityInwardsSurfaceLineCollection(); + + // Call + var properties = new MacroStabilityInwardsSurfaceLineCollectionProperties(collection); + + // Assert + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(1, dynamicProperties.Count); + + PropertyDescriptor surfaceLineCollectionProperty = dynamicProperties[0]; + Assert.IsNotNull(surfaceLineCollectionProperty); + Assert.IsTrue(surfaceLineCollectionProperty.IsReadOnly); + Assert.AreEqual("Algemeen", surfaceLineCollectionProperty.Category); + Assert.AreEqual("Bronlocatie", surfaceLineCollectionProperty.DisplayName); + Assert.AreEqual( + "De locatie van het bestand waaruit de profielschematisaties zijn geïmporteerd.", + surfaceLineCollectionProperty.Description); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsSurfaceLinePropertiesTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsSurfaceLinePropertiesTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsSurfaceLinePropertiesTest.cs (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -0,0 +1,248 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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.ComponentModel; +using Core.Common.Base.Geometry; +using Core.Common.Gui.PropertyBag; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.Forms.PropertyClasses; +using Ringtoets.MacroStabilityInwards.Primitives; + +namespace Ringtoets.MacroStabilityInwards.Forms.Test.PropertyClasses +{ + [TestFixture] + public class MacroStabilityInwardsSurfaceLinePropertiesTest + { + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var properties = new MacroStabilityInwardsSurfaceLineProperties(); + + // Assert + Assert.IsInstanceOf>(properties); + Assert.IsNull(properties.Data); + } + + [Test] + public void GetProperties_WithData_ReturnExpectedValues() + { + // Setup + const string expectedName = ""; + var point1 = new Point3D(1.1, 2.2, 3.3); + var point2 = new Point3D(2.1, 2.3, 3.3); + var point3 = new Point3D(3.8, 2.4, 5.5); + var point4 = new Point3D(4.4, 2.5, 4.4); + var point5 = new Point3D(5.1, 2.6, 3.3); + var point6 = new Point3D(6.1, 2.7, 3.3); + var point7 = new Point3D(7.4, 2.8, 1.2); + var point8 = new Point3D(8.2, 2.9, 1.2); + var point9 = new Point3D(9.3, 3.2, 1.0); + var point10 = new Point3D(10.1, 3.5, 0.5); + var point11 = new Point3D(12.2, 3.8, 0.5); + var point12 = new Point3D(13.1, 4.2, 1.0); + var point13 = new Point3D(15.1, 5.6, 1.1); + + var surfaceLine = new MacroStabilityInwardsSurfaceLine + { + Name = expectedName + }; + surfaceLine.SetGeometry(new[] + { + point1, + point2, + point3, + point4, + point5, + point6, + point7, + point8, + point9, + point10, + point11, + point12, + point13 + }); + + surfaceLine.SetSurfaceLevelOutsideAt(point1); + surfaceLine.SetDikeToeAtRiverAt(point2); + surfaceLine.SetDikeTopAtPolderAt(point3); + surfaceLine.SetShoulderBaseInsideAt(point4); + surfaceLine.SetTrafficLoadOutsideAt(point5); + surfaceLine.SetTrafficLoadInsideAt(point6); + surfaceLine.SetShoulderTopInsideAt(point7); + surfaceLine.SetDikeToeAtPolderAt(point8); + surfaceLine.SetDitchDikeSideAt(point9); + surfaceLine.SetBottomDitchDikeSideAt(point10); + surfaceLine.SetBottomDitchPolderSideAt(point11); + surfaceLine.SetDitchPolderSideAt(point12); + surfaceLine.SetSurfaceLevelInsideAt(point13); + + var properties = new MacroStabilityInwardsSurfaceLineProperties + { + Data = surfaceLine + }; + + // Call & Assert + Assert.AreEqual(expectedName, properties.Name); + CollectionAssert.AreEqual(surfaceLine.Points, properties.Points); + Assert.AreEqual(surfaceLine.SurfaceLevelOutside, properties.SurfaceLevelOutside); + Assert.AreEqual(surfaceLine.DikeToeAtRiver, properties.DikeToeAtRiver); + Assert.AreEqual(surfaceLine.DikeTopAtPolder, properties.DikeTopAtPolder); + Assert.AreEqual(surfaceLine.ShoulderBaseInside, properties.ShoulderBaseInside); + Assert.AreEqual(surfaceLine.TrafficLoadOutside, properties.TrafficLoadOutside); + Assert.AreEqual(surfaceLine.TrafficLoadInside, properties.TrafficLoadInside); + Assert.AreEqual(surfaceLine.ShoulderTopInside, properties.ShoulderTopInside); + Assert.AreEqual(surfaceLine.DikeToeAtPolder, properties.DikeToeAtPolder); + Assert.AreEqual(surfaceLine.DitchDikeSide, properties.DitchDikeSide); + Assert.AreEqual(surfaceLine.BottomDitchDikeSide, properties.BottomDitchDikeSide); + Assert.AreEqual(surfaceLine.BottomDitchPolderSide, properties.BottomDitchPolderSide); + Assert.AreEqual(surfaceLine.DitchPolderSide, properties.DitchPolderSide); + Assert.AreEqual(surfaceLine.SurfaceLevelInside, properties.SurfaceLevelInside); + } + + [Test] + public void Constructor_Always_PropertiesHaveExpectedAttributesValues() + { + // Setup + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + + // Call + var properties = new MacroStabilityInwardsSurfaceLineProperties + { + Data = surfaceLine + }; + + // Assert + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(15, dynamicProperties.Count); + + const string generalCategory = "Algemeen"; + const string charactersticPointsCategory = "Karakteristieke punten"; + + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + dynamicProperties[0], + generalCategory, + "Naam", + "Naam van de profielschematisatie.", + true); + + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + dynamicProperties[1], + generalCategory, + "Geometriepunten", + "De punten die de geometrie van de profielschematisatie definiëren.", + true); + + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + dynamicProperties[2], + charactersticPointsCategory, + "Maaiveld buitenwaarts", + "De locatie van het maaiveld buiten de polder.", + true); + + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + dynamicProperties[3], + charactersticPointsCategory, + "Teen dijk buitenwaarts", + "De locatie van de teen van de dijk wanneer de dijk van buiten de polder wordt benaderd.", + true); + + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + dynamicProperties[4], + charactersticPointsCategory, + "Verkeersbelasting kant buitenwaarts", + "De locatie van de verkeersbelasting wanneer de dijk van buiten de polder wordt benaderd.", + true); + + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + dynamicProperties[5], + charactersticPointsCategory, + "Verkeersbelasting kant binnenwaarts", + "De locatie van de verkeersbelasting wanneer de dijk van binnen de polder wordt benaderd.", + true); + + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + dynamicProperties[6], + charactersticPointsCategory, + "Kruin binnentalud", + "De kruin van het talud wanneer de dijk van binnen de polder wordt benaderd.", + true); + + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + dynamicProperties[7], + charactersticPointsCategory, + "Insteek binnenberm", + "De locatie van de insteek van de binnenberm.", + true); + + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + dynamicProperties[8], + charactersticPointsCategory, + "Kruin binnenberm", + "De locatie van de kruin van de binnenberm.", + true); + + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + dynamicProperties[9], + charactersticPointsCategory, + "Teen dijk binnenwaarts", + "De locatie van de teen van de dijk wanneer de dijk van binnen de polder wordt benaderd.", + true); + + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + dynamicProperties[10], + charactersticPointsCategory, + "Insteek sloot dijkzijde", + "De locatie van het begin van de sloot wanneer deze van de kant van de dijk wordt benaderd.", + true); + + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + dynamicProperties[11], + charactersticPointsCategory, + "Slootbodem dijkzijde", + "De locatie van het begin van de slootbodem wanneer deze van de kant van de dijk wordt benaderd.", + true); + + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + dynamicProperties[12], + charactersticPointsCategory, + "Slootbodem polderzijde", + "De locatie van het begin van de slootbodem wanneer deze van binnen de polder wordt benaderd.", + true); + + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + dynamicProperties[13], + charactersticPointsCategory, + "Insteek sloot polderzijde", + "De locatie van het begin van de sloot wanneer deze van binnen de polder wordt benaderd.", + true); + + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + dynamicProperties[14], + charactersticPointsCategory, + "Maaiveld binnenwaarts", + "De locatie van het maaiveld binnen de polder.", + true); + } + } +} \ No newline at end of file Fisheye: Tag cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/RingtoetsMacroStabilityInwardsSurfaceLineCollectionPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/RingtoetsMacroStabilityInwardsSurfaceLinePropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Ringtoets.MacroStabilityInwards.Forms.Test.csproj =================================================================== diff -u -r4a60f6ca9a08736cfaf0fac6e6f2e89e9fa59aae -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Ringtoets.MacroStabilityInwards.Forms.Test.csproj (.../Ringtoets.MacroStabilityInwards.Forms.Test.csproj) (revision 4a60f6ca9a08736cfaf0fac6e6f2e89e9fa59aae) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Ringtoets.MacroStabilityInwards.Forms.Test.csproj (.../Ringtoets.MacroStabilityInwards.Forms.Test.csproj) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -66,11 +66,11 @@ - + - + @@ -80,7 +80,7 @@ - + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditorTest.cs =================================================================== diff -u -r07783a47e1cfb0bd793eaba29c7567cb17e0b367 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditorTest.cs (.../MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditorTest.cs) (revision 07783a47e1cfb0bd793eaba29c7567cb17e0b367) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditorTest.cs (.../MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditorTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -62,7 +62,7 @@ }; var inputContext = new MacroStabilityInwardsInputContext(input, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), new[] { new TestStochasticSoilModel() @@ -118,7 +118,7 @@ stochasticSoilProfile } }; - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(2, 1, 0), @@ -136,7 +136,7 @@ }; var inputParametersContext = new MacroStabilityInwardsInputContext(input, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), new[] { stochasticSoilModel Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditorTest.cs =================================================================== diff -u -r07783a47e1cfb0bd793eaba29c7567cb17e0b367 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditorTest.cs (.../MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditorTest.cs) (revision 07783a47e1cfb0bd793eaba29c7567cb17e0b367) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditorTest.cs (.../MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditorTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -65,7 +65,7 @@ }; var inputContext = new MacroStabilityInwardsInputContext(input, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), new[] { new TestStochasticSoilModel() @@ -121,7 +121,7 @@ stochasticSoilProfile } }; - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(2, 1, 0), @@ -139,7 +139,7 @@ }; var inputParametersContext = new MacroStabilityInwardsInputContext(input, calculationItem, - Enumerable.Empty(), + Enumerable.Empty(), new[] { stochasticSoilModel Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextSurfaceLineSelectionEditorTest.cs =================================================================== diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextSurfaceLineSelectionEditorTest.cs (.../MacroStabilityInwardsInputContextSurfaceLineSelectionEditorTest.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextSurfaceLineSelectionEditorTest.cs (.../MacroStabilityInwardsInputContextSurfaceLineSelectionEditorTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -62,7 +62,7 @@ calculationItem, new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine() + new MacroStabilityInwardsSurfaceLine() }, Enumerable.Empty(), failureMechanism, @@ -100,7 +100,7 @@ var assessmentSection = mockRepository.Stub(); var handler = mockRepository.Stub(); - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0.0, 0.0, 0.0), @@ -144,9 +144,9 @@ mockRepository.VerifyAll(); } - private static RingtoetsMacroStabilityInwardsSurfaceLine ValidSurfaceLine() + private static MacroStabilityInwardsSurfaceLine ValidSurfaceLine() { - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0.0, 0.0, 0.0), Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsCalculationsViewTest.cs =================================================================== diff -u -rd47809e3a8fadff2be5b10056b79b16dc27eeca2 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsCalculationsViewTest.cs (.../MacroStabilityInwardsCalculationsViewTest.cs) (revision d47809e3a8fadff2be5b10056b79b16dc27eeca2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsCalculationsViewTest.cs (.../MacroStabilityInwardsCalculationsViewTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -433,7 +433,7 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); failureMechanism.SurfaceLines.AddRange(new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine() + new MacroStabilityInwardsSurfaceLine() }, "path"); using (MacroStabilityInwardsCalculationsView macroStabilityInwardsCalculationsView = ShowMacroStabilityInwardsCalculationsView()) @@ -457,7 +457,7 @@ const string arbitrarySourcePath = "path"; failureMechanism.SurfaceLines.AddRange(new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine() + new MacroStabilityInwardsSurfaceLine() }, arbitrarySourcePath); failureMechanism.StochasticSoilModels.AddRange(new[] { @@ -531,11 +531,11 @@ const string arbitraryFilePath = "path"; failureMechanism.SurfaceLines.AddRange(new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = "Line A" }, - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = "Line B" } @@ -583,11 +583,11 @@ const string arbitraryFilePath = "path"; failureMechanism.SurfaceLines.AddRange(new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = "Line A" }, - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = "Line B" } @@ -627,11 +627,11 @@ const string arbitryFilePath = "path"; failureMechanism.SurfaceLines.AddRange(new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = "Line A" }, - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = "Line B" } @@ -771,7 +771,7 @@ // When failureMechanism.SurfaceLines.AddRange(new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine() + new MacroStabilityInwardsSurfaceLine() }, "path"); failureMechanism.NotifyObservers(); @@ -794,7 +794,7 @@ const string arbitraryFilePath = "path"; failureMechanism.SurfaceLines.AddRange(new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine() + new MacroStabilityInwardsSurfaceLine() }, arbitraryFilePath); failureMechanism.StochasticSoilModels.AddRange(new[] { @@ -820,7 +820,7 @@ const string arbitraryFilePath = "path"; failureMechanism.SurfaceLines.AddRange(new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine() + new MacroStabilityInwardsSurfaceLine() }, arbitraryFilePath); failureMechanism.StochasticSoilModels.AddRange(new[] { @@ -844,7 +844,7 @@ const string arbitraryFilePath = "path"; failureMechanism.SurfaceLines.AddRange(new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine() + new MacroStabilityInwardsSurfaceLine() }, arbitraryFilePath); failureMechanism.StochasticSoilModels.AddRange(new[] { @@ -1097,8 +1097,8 @@ Assert.AreEqual(1, dataGridView.Rows.Count); Assert.AreEqual("Calculation 2", dataGridView.Rows[0].Cells[nameColumnIndex].FormattedValue); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLineToChange = calculation.InputParameters.SurfaceLine; - var updatedSurfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + MacroStabilityInwardsSurfaceLine surfaceLineToChange = calculation.InputParameters.SurfaceLine; + var updatedSurfaceLine = new MacroStabilityInwardsSurfaceLine { Name = surfaceLineToChange.Name, ReferenceLineIntersectionWorldPoint = new Point2D(9.0, 0.0) @@ -1164,7 +1164,7 @@ private MacroStabilityInwardsCalculationsView ShowSimpleMacroStabilityInwardsCalculationsViewWithSurfaceLines(IAssessmentSection assessmentSection) { - var surfaceLine1 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine1 = new MacroStabilityInwardsSurfaceLine { Name = "Surface line 1", ReferenceLineIntersectionWorldPoint = new Point2D(0.0, 0.0) @@ -1177,7 +1177,7 @@ new Point3D(0.0, -5.0, 0.0) }); - var surfaceLine2 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine2 = new MacroStabilityInwardsSurfaceLine { Name = "Surface line 2", ReferenceLineIntersectionWorldPoint = new Point2D(5.0, 0.0) @@ -1296,7 +1296,7 @@ private static MacroStabilityInwardsFailureMechanism ConfigureSimpleFailureMechanism() { - var surfaceLine1 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine1 = new MacroStabilityInwardsSurfaceLine { Name = "Surface line 1", ReferenceLineIntersectionWorldPoint = new Point2D(0.0, 0.0) @@ -1309,7 +1309,7 @@ new Point3D(0.0, -5.0, 0.0) }); - var surfaceLine2 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine2 = new MacroStabilityInwardsSurfaceLine { Name = "Surface line 2", ReferenceLineIntersectionWorldPoint = new Point2D(5.0, 0.0) @@ -1389,7 +1389,7 @@ private static MacroStabilityInwardsFailureMechanism ConfigureFailuremechanism() { - var surfaceLine1 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine1 = new MacroStabilityInwardsSurfaceLine { Name = "Surface line 1", ReferenceLineIntersectionWorldPoint = new Point2D(0.0, 0.0) @@ -1402,7 +1402,7 @@ new Point3D(0.0, -5.0, 0.0) }); - var surfaceLine2 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine2 = new MacroStabilityInwardsSurfaceLine { Name = "Surface line 2", ReferenceLineIntersectionWorldPoint = new Point2D(5.0, 0.0) Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsFailureMechanismViewTest.cs =================================================================== diff -u -rcfe30fb624bcc031454e7ff22e333386ed6ead87 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsFailureMechanismViewTest.cs (.../MacroStabilityInwardsFailureMechanismViewTest.cs) (revision cfe30fb624bcc031454e7ff22e333386ed6ead87) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsFailureMechanismViewTest.cs (.../MacroStabilityInwardsFailureMechanismViewTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -267,7 +267,7 @@ new Point2D(3.3, 4.4) }); - var surfaceLineA = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLineA = new MacroStabilityInwardsSurfaceLine { Name = "Line A" }; @@ -277,7 +277,7 @@ new Point3D(3.0, 0.0, 1.7) }); - var surfaceLineB = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLineB = new MacroStabilityInwardsSurfaceLine { Name = "Name B" }; @@ -560,7 +560,7 @@ IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; var failureMechanism = new MacroStabilityInwardsFailureMechanism(); var failureMechanismContext = new MacroStabilityInwardsFailureMechanismContext(failureMechanism, new ObservableTestAssessmentSectionStub()); - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); var geometry1 = new Collection { @@ -599,7 +599,7 @@ using (var view = new MacroStabilityInwardsFailureMechanismView()) { IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); var failureMechanism = new MacroStabilityInwardsFailureMechanism(); failureMechanism.SurfaceLines.AddRange(new[] { @@ -725,14 +725,14 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); var failureMechanismContext = new MacroStabilityInwardsFailureMechanismContext(failureMechanism, new ObservableTestAssessmentSectionStub()); - var surfaceLineA = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLineA = new MacroStabilityInwardsSurfaceLine(); surfaceLineA.SetGeometry(new[] { new Point3D(0.0, 0.0, 1.0), new Point3D(3.0, 0.0, 1.7) }); - var surfaceLineB = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLineB = new MacroStabilityInwardsSurfaceLine(); surfaceLineB.SetGeometry(new[] { new Point3D(0.0, 0.0, 1.5), @@ -774,14 +774,14 @@ { IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; - var surfaceLineA = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLineA = new MacroStabilityInwardsSurfaceLine(); surfaceLineA.SetGeometry(new[] { new Point3D(0.0, 0.0, 1.0), new Point3D(3.0, 0.0, 1.7) }); - var surfaceLineB = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLineB = new MacroStabilityInwardsSurfaceLine(); surfaceLineB.SetGeometry(new[] { new Point3D(0.0, 0.0, 1.5), @@ -824,14 +824,14 @@ { IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; - var surfaceLineA = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLineA = new MacroStabilityInwardsSurfaceLine(); surfaceLineA.SetGeometry(new[] { new Point3D(0.0, 0.0, 1.0), new Point3D(3.0, 0.0, 1.7) }); - var surfaceLineB = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLineB = new MacroStabilityInwardsSurfaceLine(); surfaceLineB.SetGeometry(new[] { new Point3D(0.0, 0.0, 1.5), @@ -995,18 +995,18 @@ } } - private static void AssertSurfaceLinesMapData(IEnumerable surfaceLines, MapData mapData) + private static void AssertSurfaceLinesMapData(IEnumerable surfaceLines, MapData mapData) { Assert.IsInstanceOf(mapData); var surfaceLinesMapData = (MapLineData) mapData; MapFeature[] surfaceLineFeatures = surfaceLinesMapData.Features.ToArray(); - RingtoetsMacroStabilityInwardsSurfaceLine[] surfaceLinesArray = surfaceLines.ToArray(); + MacroStabilityInwardsSurfaceLine[] surfaceLinesArray = surfaceLines.ToArray(); Assert.AreEqual(surfaceLinesArray.Length, surfaceLineFeatures.Length); for (var index = 0; index < surfaceLinesArray.Length; index++) { Assert.AreEqual(1, surfaceLineFeatures[index].MapGeometries.Count()); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = surfaceLinesArray[index]; + MacroStabilityInwardsSurfaceLine surfaceLine = surfaceLinesArray[index]; CollectionAssert.AreEquivalent(surfaceLine.Points.Select(p => new Point2D(p.X, p.Y)), surfaceLineFeatures[index].MapGeometries.First().PointCollections.First()); } Assert.AreEqual("Profielschematisaties", mapData.Name); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsInputViewTest.cs =================================================================== diff -u -r6483bd7c2aef66cc8ae0879ba2b2b261aa0cb32a -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsInputViewTest.cs (.../MacroStabilityInwardsInputViewTest.cs) (revision 6483bd7c2aef66cc8ae0879ba2b2b261aa0cb32a) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsInputViewTest.cs (.../MacroStabilityInwardsInputViewTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -207,7 +207,7 @@ // Setup using (var view = new MacroStabilityInwardsInputView()) { - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); StochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile(); var calculation = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()) @@ -254,7 +254,7 @@ // Setup using (var view = new MacroStabilityInwardsInputView()) { - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); var calculation = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()) { InputParameters = @@ -283,7 +283,7 @@ // Setup using (var view = new MacroStabilityInwardsInputView()) { - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); var calculation = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()) { InputParameters = @@ -421,7 +421,7 @@ using (var view = new MacroStabilityInwardsInputView()) { - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); var calculation = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()) { @@ -438,7 +438,7 @@ surfaceLineChartData.Attach(observer); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine2 = GetSecondSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine2 = GetSecondSurfaceLineWithGeometry(); calculation.InputParameters.SurfaceLine = surfaceLine2; @@ -466,7 +466,7 @@ using (var view = new MacroStabilityInwardsInputView()) { - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); StochasticSoilProfile soilProfile = GetStochasticSoilProfile(); var soilProfile2 = new StochasticSoilProfile(0.5, SoilProfileType.SoilProfile1D, 1) { @@ -571,7 +571,7 @@ Assert.AreEqual("Teen dijk buitenwaarts", dikeToeAtRiverData.Name); Assert.AreEqual("Maaiveld buitenwaarts", surfaceLevelOutsideData.Name); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); calculation.InputParameters.SurfaceLine = surfaceLine; // Call @@ -642,7 +642,7 @@ view.Data = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine2 = GetSecondSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine2 = GetSecondSurfaceLineWithGeometry(); calculation1.InputParameters.SurfaceLine = surfaceLine2; @@ -661,7 +661,7 @@ // Given using (var view = new MacroStabilityInwardsInputView()) { - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); + MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); StochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile(); var calculation = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()) { @@ -713,7 +713,7 @@ }; } - private static RingtoetsMacroStabilityInwardsSurfaceLine GetSurfaceLineWithGeometry() + private static MacroStabilityInwardsSurfaceLine GetSurfaceLineWithGeometry() { var points = new[] { @@ -724,7 +724,7 @@ return GetSurfaceLine(points); } - private static RingtoetsMacroStabilityInwardsSurfaceLine GetSecondSurfaceLineWithGeometry() + private static MacroStabilityInwardsSurfaceLine GetSecondSurfaceLineWithGeometry() { var points = new[] { @@ -735,9 +735,9 @@ return GetSurfaceLine(points); } - private static RingtoetsMacroStabilityInwardsSurfaceLine GetSurfaceLine(Point3D[] points) + private static MacroStabilityInwardsSurfaceLine GetSurfaceLine(Point3D[] points) { - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { Name = "Surface line name" }; @@ -834,7 +834,7 @@ } } - private static void AssertSurfaceLineChartData(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, ChartData chartData) + private static void AssertSurfaceLineChartData(MacroStabilityInwardsSurfaceLine surfaceLine, ChartData chartData) { Assert.IsInstanceOf(chartData); var surfaceLineChartData = (ChartLineData) chartData; Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsScenariosViewTest.cs =================================================================== diff -u -r38499aa6936706c30ac12e481233d3f13545dd8b -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsScenariosViewTest.cs (.../MacroStabilityInwardsScenariosViewTest.cs) (revision 38499aa6936706c30ac12e481233d3f13545dd8b) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsScenariosViewTest.cs (.../MacroStabilityInwardsScenariosViewTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -294,7 +294,7 @@ private MacroStabilityInwardsScenariosView ShowFullyConfiguredMacroStabilityInwardsScenarioView() { - var surfaceLine1 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine1 = new MacroStabilityInwardsSurfaceLine { Name = "Surface line 1", ReferenceLineIntersectionWorldPoint = new Point2D(0.0, 0.0) @@ -307,7 +307,7 @@ new Point3D(0.0, -5.0, 0.0) }); - var surfaceLine2 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine2 = new MacroStabilityInwardsSurfaceLine { Name = "Surface line 2", ReferenceLineIntersectionWorldPoint = new Point2D(5.0, 0.0) Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/Configurations/MacroStabilityInwardsCalculationConfigurationImporterTest.cs =================================================================== diff -u -rcbf7b4ba9b60558ba8827706bb2ebc5f53cfe063 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/Configurations/MacroStabilityInwardsCalculationConfigurationImporterTest.cs (.../MacroStabilityInwardsCalculationConfigurationImporterTest.cs) (revision cbf7b4ba9b60558ba8827706bb2ebc5f53cfe063) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/Configurations/MacroStabilityInwardsCalculationConfigurationImporterTest.cs (.../MacroStabilityInwardsCalculationConfigurationImporterTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -163,7 +163,7 @@ string filePath = Path.Combine(importerPath, "validConfigurationCalculationContainingNonIntersectingSurfaceLineAndSoilModel.xml"); var calculationGroup = new CalculationGroup(); - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { Name = "Profielschematisatie" }; @@ -213,7 +213,7 @@ string filePath = Path.Combine(importerPath, "validConfigurationCalculationContainingUnknownSoilProfile.xml"); var calculationGroup = new CalculationGroup(); - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { Name = "Profielschematisatie" }; @@ -378,7 +378,7 @@ string filePath = Path.Combine(readerPath, file); var calculationGroup = new CalculationGroup(); - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { Name = "Profielschematisatie" }; Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/Importers/MacroStabilityInwardsSurfaceLineExtensionsTest.cs =================================================================== diff -u -rb2d6fb0b948754d598692e76e2dc1a25b311d7e7 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/Importers/MacroStabilityInwardsSurfaceLineExtensionsTest.cs (.../MacroStabilityInwardsSurfaceLineExtensionsTest.cs) (revision b2d6fb0b948754d598692e76e2dc1a25b311d7e7) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/Importers/MacroStabilityInwardsSurfaceLineExtensionsTest.cs (.../MacroStabilityInwardsSurfaceLineExtensionsTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -160,7 +160,7 @@ public void SetCharacteristicPoints_SurfaceLineNull_ThrowsArgumentNullException() { // Call - TestDelegate test = () => ((RingtoetsMacroStabilityInwardsSurfaceLine) null).SetCharacteristicPoints(new CharacteristicPoints("Empty")); + TestDelegate test = () => ((MacroStabilityInwardsSurfaceLine) null).SetCharacteristicPoints(new CharacteristicPoints("Empty")); // Assert var exception = Assert.Throws(test); @@ -172,7 +172,7 @@ { // Setup const string name = "Some line name"; - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { Name = name }; @@ -199,7 +199,7 @@ public void SetCharacteristicPoints_ValidSituations_PointsAreSet(CharacteristicPoints points) { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(CharacteristicPointsToGeometry(points)); // Call @@ -226,7 +226,7 @@ public void SetCharacteristicPoints_UndefinedMandatoryPoint_ThrowsSurfaceLineTransformException(CharacteristicPoints points, string pointDescription) { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { Name = points.Name }; @@ -249,7 +249,7 @@ string pointDescription) { // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { Name = points.Name }; Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/Importers/MacrostabilityInwardsSurfaceLineTransformerTest.cs =================================================================== diff -u -rdf853f988ad99b935860c361bc000f6aba9876a7 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/Importers/MacrostabilityInwardsSurfaceLineTransformerTest.cs (.../MacrostabilityInwardsSurfaceLineTransformerTest.cs) (revision df853f988ad99b935860c361bc000f6aba9876a7) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/Importers/MacrostabilityInwardsSurfaceLineTransformerTest.cs (.../MacrostabilityInwardsSurfaceLineTransformerTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -42,42 +42,42 @@ { yield return new TestCaseData( new Action((cp, p) => cp.TrafficLoadOutside = p), - new Func(sl => sl.TrafficLoadOutside), + new Func(sl => sl.TrafficLoadOutside), "Verkeersbelasting kant buitenwaarts") .SetName("Move TrafficLoadOutside"); yield return new TestCaseData( new Action((cp, p) => cp.TrafficLoadInside = p), - new Func(sl => sl.TrafficLoadInside), + new Func(sl => sl.TrafficLoadInside), "Verkeersbelasting kant binnenwaarts") .SetName("Move TrafficLoadInside"); yield return new TestCaseData( new Action((cp, p) => cp.ShoulderBaseInside = p), - new Func(sl => sl.ShoulderBaseInside), + new Func(sl => sl.ShoulderBaseInside), "Insteek binnenberm") .SetName("Move ShoulderBaseInside"); yield return new TestCaseData( new Action((cp, p) => cp.ShoulderTopInside = p), - new Func(sl => sl.ShoulderTopInside), + new Func(sl => sl.ShoulderTopInside), "Kruin binnenberm") .SetName("Move ShoulderTopInside"); yield return new TestCaseData( new Action((cp, p) => cp.DitchDikeSide = p), - new Func(sl => sl.DitchDikeSide), + new Func(sl => sl.DitchDikeSide), "Insteek sloot dijkzijde") .SetName("Move DitchDikeSide"); yield return new TestCaseData( new Action((cp, p) => cp.BottomDitchDikeSide = p), - new Func(sl => sl.BottomDitchDikeSide), + new Func(sl => sl.BottomDitchDikeSide), "Slootbodem dijkzijde") .SetName("Move BottomDitchDikeSide"); yield return new TestCaseData( new Action((cp, p) => cp.BottomDitchPolderSide = p), - new Func(sl => sl.BottomDitchPolderSide), + new Func(sl => sl.BottomDitchPolderSide), "Slootbodem polderzijde") .SetName("Move BottomDitchPolderSide"); yield return new TestCaseData( new Action((cp, p) => cp.DitchPolderSide = p), - new Func(sl => sl.DitchPolderSide), + new Func(sl => sl.DitchPolderSide), "Insteek sloot polderzijde") .SetName("Move DitchPolderSide"); } @@ -89,27 +89,27 @@ { yield return new TestCaseData( new Action((cp, p) => cp.SurfaceLevelOutside = p), - new Func(sl => sl.SurfaceLevelOutside), + new Func(sl => sl.SurfaceLevelOutside), "Maaiveld buitenwaarts") .SetName("Move SurfaceLevelOutside"); yield return new TestCaseData( new Action((cp, p) => cp.DikeToeAtRiver = p), - new Func(sl => sl.DikeToeAtRiver), + new Func(sl => sl.DikeToeAtRiver), "Teen dijk buitenwaarts") .SetName("Move DikeToeAtRiver"); yield return new TestCaseData( new Action((cp, p) => cp.DikeTopAtPolder = p), - new Func(sl => sl.DikeTopAtPolder), + new Func(sl => sl.DikeTopAtPolder), "Kruin binnentalud") .SetName("Move DikeTopAtPolder"); yield return new TestCaseData( new Action((cp, p) => cp.DikeToeAtPolder = p), - new Func(sl => sl.DikeToeAtPolder), + new Func(sl => sl.DikeToeAtPolder), "Teen dijk binnenwaarts") .SetName("Move DikeToeAtPolder"); yield return new TestCaseData( new Action((cp, p) => cp.SurfaceLevelInside = p), - new Func(sl => sl.SurfaceLevelInside), + new Func(sl => sl.SurfaceLevelInside), "Maaiveld binnenwaarts") .SetName("Move SurfaceLevelInside"); } @@ -222,7 +222,7 @@ new Point2D(6.8, 15) }); - RingtoetsMacroStabilityInwardsSurfaceLine result = null; + MacroStabilityInwardsSurfaceLine result = null; // Call TestDelegate test = () => result = transformer.Transform(surfaceLine, null); @@ -236,7 +236,7 @@ [Test] [TestCaseSource(nameof(MoveOptionalCharacteristicPoint))] - public void Transform_OptionalCharacteristicPointNotOnSurfaceLine_LogErrorAndReturnSurfaceLineWithoutCharacteristicPointSet(Action pointChange, Func pointWhichIsNull, string changedCharacteristicPointName) + public void Transform_OptionalCharacteristicPointNotOnSurfaceLine_LogErrorAndReturnSurfaceLineWithoutCharacteristicPointSet(Action pointChange, Func pointWhichIsNull, string changedCharacteristicPointName) { // Setup var referenceLine = new ReferenceLine(); @@ -288,7 +288,7 @@ new Point2D(6.8, 15) }); - RingtoetsMacroStabilityInwardsSurfaceLine result = null; + MacroStabilityInwardsSurfaceLine result = null; // Call Action call = () => result = transformer.Transform(surfaceLine, characteristicPoints); @@ -323,7 +323,7 @@ [Test] [TestCaseSource(nameof(MoveMandatoryCharacteristicPoint))] - public void Transform_MandatoryCharacteristicPointNotOnSurfaceLine_ThrowsSurfaceLineTransformException(Action pointChange, Func pointWhichIsNull, string changedCharacteristicPointName) + public void Transform_MandatoryCharacteristicPointNotOnSurfaceLine_ThrowsSurfaceLineTransformException(Action pointChange, Func pointWhichIsNull, string changedCharacteristicPointName) { // Setup var referenceLine = new ReferenceLine(); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorInputTest.cs =================================================================== diff -u -rd47809e3a8fadff2be5b10056b79b16dc27eeca2 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorInputTest.cs (.../MacroStabilityInwardsCalculatorInputTest.cs) (revision d47809e3a8fadff2be5b10056b79b16dc27eeca2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorInputTest.cs (.../MacroStabilityInwardsCalculatorInputTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -46,7 +46,7 @@ var random = new Random(11); double hRiverValue = random.NextDouble(); - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); var soilProfile = new MacroStabilityInwardsSoilProfile1D(string.Empty, random.NextDouble(), new[] { new MacroStabilityInwardsSoilLayer1D(random.NextDouble()) Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorTest.cs =================================================================== diff -u -rd47809e3a8fadff2be5b10056b79b16dc27eeca2 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorTest.cs (.../MacroStabilityInwardsCalculatorTest.cs) (revision d47809e3a8fadff2be5b10056b79b16dc27eeca2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorTest.cs (.../MacroStabilityInwardsCalculatorTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -109,9 +109,9 @@ }, SoilProfileType.SoilProfile1D, 1234L); } - private static RingtoetsMacroStabilityInwardsSurfaceLine CreateValidSurfaceLine() + private static MacroStabilityInwardsSurfaceLine CreateValidSurfaceLine() { - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); surfaceLine.SetGeometry(new[] { new Point3D(0, 0, 2), Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ExportInfos/MacroStabilityInwardsCalculationContextExportInfoTest.cs =================================================================== diff -u -r7261037d9779a908ec89ded5b4fdb73c568a9606 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ExportInfos/MacroStabilityInwardsCalculationContextExportInfoTest.cs (.../MacroStabilityInwardsCalculationContextExportInfoTest.cs) (revision 7261037d9779a908ec89ded5b4fdb73c568a9606) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ExportInfos/MacroStabilityInwardsCalculationContextExportInfoTest.cs (.../MacroStabilityInwardsCalculationContextExportInfoTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -66,7 +66,7 @@ mocks.ReplayAll(); var context = new MacroStabilityInwardsCalculationScenarioContext(new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()), - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), new MacroStabilityInwardsFailureMechanism(), assessmentSection); @@ -109,7 +109,7 @@ mocks.ReplayAll(); var context = new MacroStabilityInwardsCalculationScenarioContext(new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()), - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), new MacroStabilityInwardsFailureMechanism(), assessmentSection); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ExportInfos/MacroStabilityInwardsCalculationGroupContextExportInfoTest.cs =================================================================== diff -u -r7261037d9779a908ec89ded5b4fdb73c568a9606 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ExportInfos/MacroStabilityInwardsCalculationGroupContextExportInfoTest.cs (.../MacroStabilityInwardsCalculationGroupContextExportInfoTest.cs) (revision 7261037d9779a908ec89ded5b4fdb73c568a9606) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ExportInfos/MacroStabilityInwardsCalculationGroupContextExportInfoTest.cs (.../MacroStabilityInwardsCalculationGroupContextExportInfoTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -67,7 +67,7 @@ mocks.ReplayAll(); var context = new MacroStabilityInwardsCalculationGroupContext(new CalculationGroup(), - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), new MacroStabilityInwardsFailureMechanism(), assessmentSection); @@ -110,7 +110,7 @@ mocks.ReplayAll(); var context = new MacroStabilityInwardsCalculationGroupContext(new CalculationGroup(), - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), new MacroStabilityInwardsFailureMechanism(), assessmentSection); @@ -151,7 +151,7 @@ } var context = new MacroStabilityInwardsCalculationGroupContext(calculationGroup, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), new MacroStabilityInwardsFailureMechanism(), assessmentSection); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/MacroStabilityInwardsSurfaceLineReplaceDataStrategyTest.cs =================================================================== diff -u -rb04ee63f77708d3e30dd18f07dbb8ab31d548edb -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/MacroStabilityInwardsSurfaceLineReplaceDataStrategyTest.cs (.../MacroStabilityInwardsSurfaceLineReplaceDataStrategyTest.cs) (revision b04ee63f77708d3e30dd18f07dbb8ab31d548edb) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/MacroStabilityInwardsSurfaceLineReplaceDataStrategyTest.cs (.../MacroStabilityInwardsSurfaceLineReplaceDataStrategyTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -57,8 +57,8 @@ var strategy = new MacroStabilityInwardsSurfaceLineReplaceDataStrategy(new MacroStabilityInwardsFailureMechanism()); // Assert - Assert.IsInstanceOf>(strategy); - Assert.IsInstanceOf>(strategy); + Assert.IsInstanceOf>(strategy); + Assert.IsInstanceOf>(strategy); } [Test] @@ -83,7 +83,7 @@ var strategy = new MacroStabilityInwardsSurfaceLineReplaceDataStrategy(new MacroStabilityInwardsFailureMechanism()); // Call - TestDelegate test = () => strategy.UpdateSurfaceLinesWithImportedData(Enumerable.Empty(), + TestDelegate test = () => strategy.UpdateSurfaceLinesWithImportedData(Enumerable.Empty(), null); // Assert @@ -96,12 +96,12 @@ { // Setup var failureMechanism = new MacroStabilityInwardsFailureMechanism(); - RingtoetsMacroStabilityInwardsSurfaceLineCollection targetCollection = failureMechanism.SurfaceLines; + MacroStabilityInwardsSurfaceLineCollection targetCollection = failureMechanism.SurfaceLines; var strategy = new MacroStabilityInwardsSurfaceLineReplaceDataStrategy(failureMechanism); const string newSourcePath = "some/other/path"; // Call - IEnumerable affectedObjects = strategy.UpdateSurfaceLinesWithImportedData(Enumerable.Empty(), + IEnumerable affectedObjects = strategy.UpdateSurfaceLinesWithImportedData(Enumerable.Empty(), newSourcePath); // Assert @@ -119,7 +119,7 @@ // Setup var importedSurfaceLines = new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine() + new MacroStabilityInwardsSurfaceLine() }; var failureMechanism = new MacroStabilityInwardsFailureMechanism(); @@ -130,7 +130,7 @@ sourceFilePath); // Assert - RingtoetsMacroStabilityInwardsSurfaceLineCollection actualCollection = failureMechanism.SurfaceLines; + MacroStabilityInwardsSurfaceLineCollection actualCollection = failureMechanism.SurfaceLines; CollectionAssert.AreEqual(importedSurfaceLines, actualCollection); CollectionAssert.AreEqual(new[] { @@ -142,7 +142,7 @@ public void UpdateSurfaceLinesWithImportedData_WithCurrentAndImportedDataAreDifferent_ReplacesCurrentWithImportedData() { // Setup - var targetSurfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var targetSurfaceLine = new MacroStabilityInwardsSurfaceLine { Name = "Name A" }; @@ -152,7 +152,7 @@ targetSurfaceLine }, sourceFilePath); - var readSurfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var readSurfaceLine = new MacroStabilityInwardsSurfaceLine { Name = "Name B" }; @@ -182,7 +182,7 @@ public void UpdateSurfaceLinesWithImportedData_CalculationWithOutputSurfaceLine_CalculationUpdatedAndReturnsAffectedObject() { // Setup - var existingSurfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var existingSurfaceLine = new MacroStabilityInwardsSurfaceLine(); existingSurfaceLine.SetGeometry(new[] { new Point3D(0, 1, 2), @@ -208,7 +208,7 @@ var strategy = new MacroStabilityInwardsSurfaceLineReplaceDataStrategy(failureMechanism); // Call - IEnumerable affectedObjects = strategy.UpdateSurfaceLinesWithImportedData(Enumerable.Empty(), + IEnumerable affectedObjects = strategy.UpdateSurfaceLinesWithImportedData(Enumerable.Empty(), sourceFilePath).ToArray(); // Assert @@ -227,13 +227,13 @@ { // Setup const string duplicateName = "Duplicate name it is"; - RingtoetsMacroStabilityInwardsSurfaceLine[] importedSurfaceLines = + MacroStabilityInwardsSurfaceLine[] importedSurfaceLines = { - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = duplicateName }, - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = duplicateName } Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/MacroStabilityInwardsSurfaceLineUpdateDataStrategyTest.cs =================================================================== diff -u -rcfe30fb624bcc031454e7ff22e333386ed6ead87 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/MacroStabilityInwardsSurfaceLineUpdateDataStrategyTest.cs (.../MacroStabilityInwardsSurfaceLineUpdateDataStrategyTest.cs) (revision cfe30fb624bcc031454e7ff22e333386ed6ead87) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/MacroStabilityInwardsSurfaceLineUpdateDataStrategyTest.cs (.../MacroStabilityInwardsSurfaceLineUpdateDataStrategyTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -59,8 +59,8 @@ var strategy = new MacroStabilityInwardsSurfaceLineUpdateDataStrategy(new MacroStabilityInwardsFailureMechanism()); // Assert - Assert.IsInstanceOf>(strategy); - Assert.IsInstanceOf>(strategy); + Assert.IsInstanceOf>(strategy); + Assert.IsInstanceOf>(strategy); } [Test] @@ -85,7 +85,7 @@ var strategy = new MacroStabilityInwardsSurfaceLineUpdateDataStrategy(new MacroStabilityInwardsFailureMechanism()); // Call - TestDelegate test = () => strategy.UpdateSurfaceLinesWithImportedData(Enumerable.Empty(), + TestDelegate test = () => strategy.UpdateSurfaceLinesWithImportedData(Enumerable.Empty(), null); // Assert @@ -97,9 +97,9 @@ public void UpdateSurfaceLinesWithImportedData_OnlyGeometryChanged_UpdatesGeometryOnly() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = CreateValidSurfaceLineForCalculations(); + MacroStabilityInwardsSurfaceLine surfaceLine = CreateValidSurfaceLineForCalculations(); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLineToUpdateFrom = CreateValidSurfaceLineForCalculations(); + MacroStabilityInwardsSurfaceLine surfaceLineToUpdateFrom = CreateValidSurfaceLineForCalculations(); var expectedGeometry = new List { new Point3D(0, 1, 2), @@ -110,7 +110,7 @@ surfaceLineToUpdateFrom.SetGeometry(expectedGeometry); var failureMechanism = new MacroStabilityInwardsFailureMechanism(); - RingtoetsMacroStabilityInwardsSurfaceLineCollection targetCollection = failureMechanism.SurfaceLines; + MacroStabilityInwardsSurfaceLineCollection targetCollection = failureMechanism.SurfaceLines; targetCollection.AddRange(new[] { surfaceLine @@ -136,15 +136,15 @@ { // Setup const string duplicateName = "Duplicate name it is"; - var lineOne = new RingtoetsMacroStabilityInwardsSurfaceLine + var lineOne = new MacroStabilityInwardsSurfaceLine { Name = duplicateName }; lineOne.SetGeometry(new[] { new Point3D(1, 2, 3) }); - var lineTwo = new RingtoetsMacroStabilityInwardsSurfaceLine + var lineTwo = new MacroStabilityInwardsSurfaceLine { Name = duplicateName }; @@ -158,7 +158,7 @@ lineTwo }; - var targetCollection = new RingtoetsMacroStabilityInwardsSurfaceLineCollection(); + var targetCollection = new MacroStabilityInwardsSurfaceLineCollection(); var strategy = new MacroStabilityInwardsSurfaceLineUpdateDataStrategy(new MacroStabilityInwardsFailureMechanism()); // Call @@ -179,7 +179,7 @@ { // Setup const string duplicateName = "Duplicate name it is"; - var expectedSurfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var expectedSurfaceLine = new MacroStabilityInwardsSurfaceLine { Name = duplicateName }; @@ -196,16 +196,16 @@ expectedSurfaceLine }; - var targetCollection = new RingtoetsMacroStabilityInwardsSurfaceLineCollection(); + var targetCollection = new MacroStabilityInwardsSurfaceLineCollection(); targetCollection.AddRange(expectedCollection, sourceFilePath); - RingtoetsMacroStabilityInwardsSurfaceLine[] importedSurfaceLines = + MacroStabilityInwardsSurfaceLine[] importedSurfaceLines = { - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = duplicateName }, - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = duplicateName } @@ -223,7 +223,7 @@ Assert.AreEqual(expectedMessage, exception.Message); CollectionAssert.AreEqual(expectedCollection, targetCollection); - RingtoetsMacroStabilityInwardsSurfaceLine actualSurfaceLine = targetCollection[0]; + MacroStabilityInwardsSurfaceLine actualSurfaceLine = targetCollection[0]; Assert.AreEqual(expectedSurfaceLine.Name, actualSurfaceLine.Name); CollectionAssert.AreEqual(expectedGeometry, actualSurfaceLine.Points); } @@ -235,15 +235,15 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); const string collectionSurfaceLineName = "Name A"; - var targetSurfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var targetSurfaceLine = new MacroStabilityInwardsSurfaceLine(); targetSurfaceLine.Name = collectionSurfaceLineName; - RingtoetsMacroStabilityInwardsSurfaceLineCollection targetCollection = failureMechanism.SurfaceLines; + MacroStabilityInwardsSurfaceLineCollection targetCollection = failureMechanism.SurfaceLines; targetCollection.AddRange(new[] { targetSurfaceLine }, sourceFilePath); - RingtoetsMacroStabilityInwardsSurfaceLine readSurfaceLine = DeepCloneAndModifyPoints(targetSurfaceLine); + MacroStabilityInwardsSurfaceLine readSurfaceLine = DeepCloneAndModifyPoints(targetSurfaceLine); var readSurfaceLines = new[] { readSurfaceLine @@ -274,12 +274,12 @@ const string collectionSurfaceLineName = "Name A"; const string readSurfaceLineName = "Name B"; - var targetSurfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var targetSurfaceLine = new MacroStabilityInwardsSurfaceLine { Name = collectionSurfaceLineName }; - var readSurfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var readSurfaceLine = new MacroStabilityInwardsSurfaceLine { Name = readSurfaceLineName }; @@ -289,7 +289,7 @@ }; var failureMechanism = new MacroStabilityInwardsFailureMechanism(); - RingtoetsMacroStabilityInwardsSurfaceLineCollection surfaceLineCollection = failureMechanism.SurfaceLines; + MacroStabilityInwardsSurfaceLineCollection surfaceLineCollection = failureMechanism.SurfaceLines; surfaceLineCollection.AddRange(new[] { targetSurfaceLine @@ -318,26 +318,26 @@ const string removedSurfaceLineName = "Name B"; const string addedSurfaceLineName = "Name C"; - var surfaceLineOne = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLineOne = new MacroStabilityInwardsSurfaceLine { Name = updatedSurfaceLineName }; - var surfaceLineTwo = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLineTwo = new MacroStabilityInwardsSurfaceLine { Name = removedSurfaceLineName }; var failureMechanism = new MacroStabilityInwardsFailureMechanism(); - RingtoetsMacroStabilityInwardsSurfaceLineCollection surfaceLineCollection = failureMechanism.SurfaceLines; + MacroStabilityInwardsSurfaceLineCollection surfaceLineCollection = failureMechanism.SurfaceLines; surfaceLineCollection.AddRange(new[] { surfaceLineOne, surfaceLineTwo }, sourceFilePath); - RingtoetsMacroStabilityInwardsSurfaceLine readSurfaceLineOne = DeepCloneAndModifyPoints(surfaceLineOne); - var readSurfaceLineTwo = new RingtoetsMacroStabilityInwardsSurfaceLine + MacroStabilityInwardsSurfaceLine readSurfaceLineOne = DeepCloneAndModifyPoints(surfaceLineOne); + var readSurfaceLineTwo = new MacroStabilityInwardsSurfaceLine { Name = addedSurfaceLineName }; @@ -361,11 +361,11 @@ }; CollectionAssert.AreEqual(expectedSurfaceLineCollection, surfaceLineCollection); - RingtoetsMacroStabilityInwardsSurfaceLine updatedSurfaceLine = surfaceLineCollection[0]; + MacroStabilityInwardsSurfaceLine updatedSurfaceLine = surfaceLineCollection[0]; Assert.AreSame(surfaceLineOne, updatedSurfaceLine); Assert.AreEqual(readSurfaceLineOne, updatedSurfaceLine); - RingtoetsMacroStabilityInwardsSurfaceLine addedSurfaceLine = surfaceLineCollection[1]; + MacroStabilityInwardsSurfaceLine addedSurfaceLine = surfaceLineCollection[1]; Assert.AreSame(readSurfaceLineTwo, addedSurfaceLine); Assert.AreEqual(readSurfaceLineTwo, addedSurfaceLine); @@ -380,7 +380,7 @@ public void UpdateSurfaceLinesWithImportedData_CalculationWithOutputAndAssignedLineDeleted_ClearsCalculationOutput() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = CreateValidSurfaceLineForCalculations(); + MacroStabilityInwardsSurfaceLine surfaceLine = CreateValidSurfaceLineForCalculations(); var calculation = new MacroStabilityInwardsCalculation(new GeneralMacroStabilityInwardsInput()) { InputParameters = @@ -393,7 +393,7 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(calculation); - RingtoetsMacroStabilityInwardsSurfaceLineCollection surfaceLineCollection = failureMechanism.SurfaceLines; + MacroStabilityInwardsSurfaceLineCollection surfaceLineCollection = failureMechanism.SurfaceLines; surfaceLineCollection.AddRange(new[] { surfaceLine @@ -402,7 +402,7 @@ var strategy = new MacroStabilityInwardsSurfaceLineUpdateDataStrategy(failureMechanism); // Call - IEnumerable affectedObjects = strategy.UpdateSurfaceLinesWithImportedData(Enumerable.Empty(), + IEnumerable affectedObjects = strategy.UpdateSurfaceLinesWithImportedData(Enumerable.Empty(), sourceFilePath).ToArray(); // Assert @@ -423,7 +423,7 @@ const string updatedSurfaceLineName = "Name A"; const string unaffectedSurfaceLineName = "Name B"; - var affectedSurfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var affectedSurfaceLine = new MacroStabilityInwardsSurfaceLine { Name = updatedSurfaceLineName }; @@ -447,7 +447,7 @@ new Point3D(10, 9, 8), new Point3D(7, 6, 5) }; - var unaffectedSurfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var unaffectedSurfaceLine = new MacroStabilityInwardsSurfaceLine { Name = unaffectedSurfaceLineName }; @@ -463,7 +463,7 @@ }; var failureMechanism = new MacroStabilityInwardsFailureMechanism(); - RingtoetsMacroStabilityInwardsSurfaceLineCollection collection = failureMechanism.SurfaceLines; + MacroStabilityInwardsSurfaceLineCollection collection = failureMechanism.SurfaceLines; collection.AddRange(new[] { affectedSurfaceLine, @@ -473,8 +473,8 @@ failureMechanism.CalculationsGroup.Children.Add(affectedCalculation); failureMechanism.CalculationsGroup.Children.Add(unAffectedCalculation); - RingtoetsMacroStabilityInwardsSurfaceLine importedAffectedSurfaceLine = DeepCloneAndModifyPoints(affectedSurfaceLine); - RingtoetsMacroStabilityInwardsSurfaceLine importedUnaffectedSurfaceLine = DeepCloneName(unaffectedSurfaceLine); + MacroStabilityInwardsSurfaceLine importedAffectedSurfaceLine = DeepCloneAndModifyPoints(affectedSurfaceLine); + MacroStabilityInwardsSurfaceLine importedUnaffectedSurfaceLine = DeepCloneName(unaffectedSurfaceLine); importedUnaffectedSurfaceLine.SetGeometry(unaffectedGeometry); var strategy = new MacroStabilityInwardsSurfaceLineUpdateDataStrategy(failureMechanism); @@ -513,7 +513,7 @@ const string removedSurfaceLineName = "Name A"; const string unaffectedSurfaceLineName = "Name B"; - var removedSurfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var removedSurfaceLine = new MacroStabilityInwardsSurfaceLine { Name = removedSurfaceLineName }; @@ -537,7 +537,7 @@ new Point3D(10, 9, 8), new Point3D(7, 6, 5) }; - var unaffectedSurfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var unaffectedSurfaceLine = new MacroStabilityInwardsSurfaceLine { Name = unaffectedSurfaceLineName }; @@ -553,7 +553,7 @@ }; var failureMechanism = new MacroStabilityInwardsFailureMechanism(); - RingtoetsMacroStabilityInwardsSurfaceLineCollection collection = failureMechanism.SurfaceLines; + MacroStabilityInwardsSurfaceLineCollection collection = failureMechanism.SurfaceLines; collection.AddRange(new[] { removedSurfaceLine, @@ -562,7 +562,7 @@ failureMechanism.CalculationsGroup.Children.Add(affectedCalculation); failureMechanism.CalculationsGroup.Children.Add(unAffectedCalculation); - RingtoetsMacroStabilityInwardsSurfaceLine importedUnaffectedSurfaceLine = DeepCloneName(unaffectedSurfaceLine); + MacroStabilityInwardsSurfaceLine importedUnaffectedSurfaceLine = DeepCloneName(unaffectedSurfaceLine); importedUnaffectedSurfaceLine.SetGeometry(unaffectedGeometry); var strategy = new MacroStabilityInwardsSurfaceLineUpdateDataStrategy(failureMechanism); @@ -595,7 +595,7 @@ public void UpdateSurfaceLinesWithImportedData_WithCalculationAssignedToUpdatedLine_UpdatesCalculationAndStochasticSoilModel() { // Setup - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = CreateValidSurfaceLineForCalculations(); + MacroStabilityInwardsSurfaceLine surfaceLine = CreateValidSurfaceLineForCalculations(); var calculation = new MacroStabilityInwardsCalculation(new GeneralMacroStabilityInwardsInput()) { InputParameters = @@ -640,7 +640,7 @@ failureMechanism.StochasticSoilModels.AddRange(soilModels, "path"); failureMechanism.CalculationsGroup.Children.Add(calculation); - RingtoetsMacroStabilityInwardsSurfaceLine importedSurfaceLine = DeepCloneName(surfaceLine); + MacroStabilityInwardsSurfaceLine importedSurfaceLine = DeepCloneName(surfaceLine); importedSurfaceLine.SetGeometry(new[] { new Point3D(0, 0, 0), @@ -712,7 +712,7 @@ } }; - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = CreateValidSurfaceLineForCalculations(); + MacroStabilityInwardsSurfaceLine surfaceLine = CreateValidSurfaceLineForCalculations(); var calculation = new MacroStabilityInwardsCalculation(new GeneralMacroStabilityInwardsInput()) { InputParameters = @@ -730,7 +730,7 @@ }, "path"); failureMechanism.StochasticSoilModels.AddRange(soilModels, "path"); - RingtoetsMacroStabilityInwardsSurfaceLine importedSurfaceLine = DeepCloneName(surfaceLine); + MacroStabilityInwardsSurfaceLine importedSurfaceLine = DeepCloneName(surfaceLine); importedSurfaceLine.SetGeometry(new[] { new Point3D(0, 0, 0), @@ -775,7 +775,7 @@ } }; - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = CreateValidSurfaceLineForCalculations(); + MacroStabilityInwardsSurfaceLine surfaceLine = CreateValidSurfaceLineForCalculations(); var calculation = new MacroStabilityInwardsCalculation(new GeneralMacroStabilityInwardsInput()) { InputParameters = @@ -800,7 +800,7 @@ var strategy = new MacroStabilityInwardsSurfaceLineUpdateDataStrategy(failureMechanism); // Call - IEnumerable affectedObjects = strategy.UpdateSurfaceLinesWithImportedData(Enumerable.Empty(), + IEnumerable affectedObjects = strategy.UpdateSurfaceLinesWithImportedData(Enumerable.Empty(), "path").ToArray(); // Assert @@ -828,7 +828,7 @@ } }; - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = CreateValidSurfaceLineForCalculations(); + MacroStabilityInwardsSurfaceLine surfaceLine = CreateValidSurfaceLineForCalculations(); var calculation = new MacroStabilityInwardsCalculation(new GeneralMacroStabilityInwardsInput()) { InputParameters = @@ -852,7 +852,7 @@ var strategy = new MacroStabilityInwardsSurfaceLineUpdateDataStrategy(failureMechanism); // Call - IEnumerable affectedObjects = strategy.UpdateSurfaceLinesWithImportedData(Enumerable.Empty(), + IEnumerable affectedObjects = strategy.UpdateSurfaceLinesWithImportedData(Enumerable.Empty(), "path").ToArray(); // Assert @@ -873,7 +873,7 @@ // Setup const string updatedSurfaceLineName = "Name A"; - var affectedSurfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var affectedSurfaceLine = new MacroStabilityInwardsSurfaceLine { Name = updatedSurfaceLineName }; @@ -895,7 +895,7 @@ new Point3D(10, 9, 8), new Point3D(7, 6, 5) }; - var unaffectedSurfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var unaffectedSurfaceLine = new MacroStabilityInwardsSurfaceLine(); unaffectedSurfaceLine.SetGeometry(unaffectedGeometry); var unAffectedCalculation = new MacroStabilityInwardsCalculation(new GeneralMacroStabilityInwardsInput()) { @@ -943,7 +943,7 @@ }, "path"); failureMechanism.StochasticSoilModels.AddRange(soilModels, "path"); - RingtoetsMacroStabilityInwardsSurfaceLine importedSurfaceLine = DeepCloneName(affectedSurfaceLine); + MacroStabilityInwardsSurfaceLine importedSurfaceLine = DeepCloneName(affectedSurfaceLine); importedSurfaceLine.SetGeometry(new[] { new Point3D(0, 0, 0), @@ -982,7 +982,7 @@ // Setup const string updatedSurfaceLineName = "Name A"; - var affectedSurfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var affectedSurfaceLine = new MacroStabilityInwardsSurfaceLine { Name = updatedSurfaceLineName }; @@ -1009,7 +1009,7 @@ affectedSurfaceLine }, "path"); - RingtoetsMacroStabilityInwardsSurfaceLine importedSurfaceLine = DeepCloneAndModifyPoints(affectedSurfaceLine); + MacroStabilityInwardsSurfaceLine importedSurfaceLine = DeepCloneAndModifyPoints(affectedSurfaceLine); var strategy = new MacroStabilityInwardsSurfaceLineUpdateDataStrategy(failureMechanism); @@ -1029,9 +1029,9 @@ }, affectedObjects); } - private static RingtoetsMacroStabilityInwardsSurfaceLine CreateValidSurfaceLineForCalculations() + private static MacroStabilityInwardsSurfaceLine CreateValidSurfaceLineForCalculations() { - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine = new MacroStabilityInwardsSurfaceLine { Name = "Name A", ReferenceLineIntersectionWorldPoint = new Point2D(123, 456) @@ -1052,16 +1052,16 @@ /// /// Makes a deep clone of - /// and only copies the name + /// and only copies the name /// property. /// - /// The + /// The /// which needs to be deep cloned. /// A deep clone of with /// only the name property copied. - private static RingtoetsMacroStabilityInwardsSurfaceLine DeepCloneName(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + private static MacroStabilityInwardsSurfaceLine DeepCloneName(MacroStabilityInwardsSurfaceLine surfaceLine) { - return new RingtoetsMacroStabilityInwardsSurfaceLine + return new MacroStabilityInwardsSurfaceLine { Name = surfaceLine.Name }; @@ -1072,11 +1072,11 @@ /// new geometry, reference line intersection world reference point and /// characteristic points. /// - /// The + /// The /// which needs to be deep cloned and modified. /// A deep clone of with modified /// geometric and characteristic points. - private static RingtoetsMacroStabilityInwardsSurfaceLine DeepCloneAndModifyPoints(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine) + private static MacroStabilityInwardsSurfaceLine DeepCloneAndModifyPoints(MacroStabilityInwardsSurfaceLine surfaceLine) { var random = new Random(21); Point2D newIntersectionPoint = null; @@ -1087,7 +1087,7 @@ oldIntersectionPoint.Y + random.NextDouble()); } - var copiedLine = new RingtoetsMacroStabilityInwardsSurfaceLine + var copiedLine = new MacroStabilityInwardsSurfaceLine { Name = surfaceLine.Name, ReferenceLineIntersectionWorldPoint = newIntersectionPoint Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/SurfaceLinesCsvImporterConfigurationFactoryTest.cs =================================================================== diff -u -rdf853f988ad99b935860c361bc000f6aba9876a7 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/SurfaceLinesCsvImporterConfigurationFactoryTest.cs (.../SurfaceLinesCsvImporterConfigurationFactoryTest.cs) (revision df853f988ad99b935860c361bc000f6aba9876a7) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/SurfaceLinesCsvImporterConfigurationFactoryTest.cs (.../SurfaceLinesCsvImporterConfigurationFactoryTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -37,7 +37,7 @@ public void CreateUpdateStrategyConfiguration_Always_ReturnsUpdateStrategyAndTransformerForMacroStabilityInwards() { // Call - SurfaceLinesCsvImporterConfiguration result = SurfaceLinesCsvImporterConfigurationFactory.CreateUpdateStrategyConfiguration(new MacroStabilityInwardsFailureMechanism(), new ReferenceLine()); + SurfaceLinesCsvImporterConfiguration result = SurfaceLinesCsvImporterConfigurationFactory.CreateUpdateStrategyConfiguration(new MacroStabilityInwardsFailureMechanism(), new ReferenceLine()); // Assert Assert.IsNotNull(result); @@ -69,7 +69,7 @@ public void CreateReplaceStrategyConfiguration_Always_ReturnsReplaceStrategyAndTransformerForMacroStabilityInwards() { // Call - SurfaceLinesCsvImporterConfiguration result = SurfaceLinesCsvImporterConfigurationFactory.CreateReplaceStrategyConfiguration(new MacroStabilityInwardsFailureMechanism(), new ReferenceLine()); + SurfaceLinesCsvImporterConfiguration result = SurfaceLinesCsvImporterConfigurationFactory.CreateReplaceStrategyConfiguration(new MacroStabilityInwardsFailureMechanism(), new ReferenceLine()); // Assert Assert.IsNotNull(result); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ImportInfos/MacroStabilityInwardsCalculationGroupContextImportInfoTest.cs =================================================================== diff -u -rf03b47d0d73983de35188874a094ae07f1ea13fa -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ImportInfos/MacroStabilityInwardsCalculationGroupContextImportInfoTest.cs (.../MacroStabilityInwardsCalculationGroupContextImportInfoTest.cs) (revision f03b47d0d73983de35188874a094ae07f1ea13fa) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ImportInfos/MacroStabilityInwardsCalculationGroupContextImportInfoTest.cs (.../MacroStabilityInwardsCalculationGroupContextImportInfoTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -119,7 +119,7 @@ mocks.ReplayAll(); var context = new MacroStabilityInwardsCalculationGroupContext(new CalculationGroup(), - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ImportInfos/MacroStabilityInwardsSurfaceLinesContextImportInfoTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ImportInfos/MacroStabilityInwardsSurfaceLinesContextImportInfoTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ImportInfos/MacroStabilityInwardsSurfaceLinesContextImportInfoTest.cs (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -0,0 +1,250 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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.Drawing; +using System.Linq; +using Core.Common.Base.IO; +using Core.Common.Gui; +using Core.Common.Gui.Forms.MainWindow; +using Core.Common.Gui.Plugin; +using Core.Common.TestUtil; +using Core.Common.Utils; +using NUnit.Extensions.Forms; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.IO.SurfaceLines; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.MacroStabilityInwards.Forms.PresentationObjects; +using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil; +using Ringtoets.MacroStabilityInwards.Primitives; +using FormsResources = Ringtoets.MacroStabilityInwards.Forms.Properties.Resources; + +namespace Ringtoets.MacroStabilityInwards.Plugin.Test.ImportInfos +{ + [TestFixture] + public class MacroStabilityInwardsSurfaceLinesContextImportInfoTest : NUnitFormTest + { + private ImportInfo importInfo; + private MacroStabilityInwardsPlugin plugin; + + public override void Setup() + { + plugin = new MacroStabilityInwardsPlugin(); + importInfo = plugin.GetImportInfos().First(i => i.DataType == typeof(MacroStabilityInwardsSurfaceLinesContext)); + } + + public override void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Name_Always_ReturnExpectedName() + { + // Call + string name = importInfo.Name; + + // Assert + Assert.AreEqual("Profielschematisaties", name); + } + + [Test] + public void Category_Always_ReturnExpectedCategory() + { + // Call + string category = importInfo.Category; + + // Assert + Assert.AreEqual("Algemeen", category); + } + + [Test] + public void Image_Always_ReturnExpectedIcon() + { + // Call + Image image = importInfo.Image; + + // Assert + TestHelper.AssertImagesAreEqual(FormsResources.SurfaceLineIcon, image); + } + + [Test] + public void IsEnabled_ReferenceLineNull_ReturnFalse() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + + var context = new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection); + + // Call + bool isEnabled = importInfo.IsEnabled(context); + + // Assert + Assert.IsFalse(isEnabled); + mocks.VerifyAll(); + } + + [Test] + public void IsEnabled_ReferenceLineSet_ReturnTrue() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + assessmentSection.ReferenceLine = new ReferenceLine(); + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + + var context = new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection); + + // Call + bool isEnabled = importInfo.IsEnabled(context); + + // Assert + Assert.IsTrue(isEnabled); + mocks.VerifyAll(); + } + + [Test] + public void FileFilterGenerator_Always_ReturnExpectedFileFilter() + { + // Call + FileFilterGenerator fileFilterGenerator = importInfo.FileFilterGenerator; + + // Assert + Assert.AreEqual("Profielschematisaties Kommagescheiden bestand (*.csv)|*.csv", fileFilterGenerator.Filter); + } + + [Test] + public void VerifyUpdates_CalculationWithoutOutputs_ReturnsTrue() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + + var mainWindow = mocks.Stub(); + var gui = mocks.Stub(); + gui.Stub(g => g.MainWindow).Return(mainWindow); + mocks.ReplayAll(); + + plugin.Gui = gui; + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + failureMechanism.CalculationsGroup.Children.Add(new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput())); + + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + var context = new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection); + + // Call + bool updatesVerified = importInfo.VerifyUpdates(context); + + // Assert + Assert.IsTrue(updatesVerified); + mocks.VerifyAll(); + } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void VerifyUpdates_CalculationWithOutputs_AlwaysReturnsExpectedInquiryMessage(bool isActionConfirmed) + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + + var mainWindow = mocks.Stub(); + var gui = mocks.Stub(); + gui.Stub(g => g.MainWindow).Return(mainWindow); + mocks.ReplayAll(); + + plugin.Gui = gui; + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + var calculationWithOutput = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()) + { + Output = new TestMacroStabilityInwardsOutput() + }; + failureMechanism.CalculationsGroup.Children.Add(calculationWithOutput); + + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + var context = new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection); + + string textBoxMessage = null; + DialogBoxHandler = (name, wnd) => + { + var helper = new MessageBoxTester(wnd); + textBoxMessage = helper.Text; + + if (isActionConfirmed) + { + helper.ClickOk(); + } + else + { + helper.ClickCancel(); + } + }; + + // Call + bool updatesVerified = importInfo.VerifyUpdates(context); + + // Assert + string expectedInquiryMessage = "Als u profielschematisaties importeert, " + + "dan worden alle rekenresultaten van dit toetsspoor verwijderd." + + $"{Environment.NewLine}{Environment.NewLine}Weet u zeker dat u wilt doorgaan?"; + Assert.AreEqual(expectedInquiryMessage, textBoxMessage); + Assert.AreEqual(isActionConfirmed, updatesVerified); + mocks.VerifyAll(); + } + + [Test] + public void CreateFileImporter_ValidInput_ReturnFileImporter() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + assessmentSection.ReferenceLine = new ReferenceLine(); + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + + var importTarget = new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection); + + // Call + IFileImporter importer = importInfo.CreateFileImporter(importTarget, ""); + + // Assert + Assert.IsInstanceOf>(importer); + mocks.VerifyAll(); + } + } +} \ No newline at end of file Fisheye: Tag cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ImportInfos/RingtoetsMacroStabilityInwardsSurfaceLinesContextImportInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/MacroStabilityInwardsPluginTest.cs =================================================================== diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/MacroStabilityInwardsPluginTest.cs (.../MacroStabilityInwardsPluginTest.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/MacroStabilityInwardsPluginTest.cs (.../MacroStabilityInwardsPluginTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -76,13 +76,13 @@ PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, - typeof(RingtoetsMacroStabilityInwardsSurfaceLinesContext), - typeof(RingtoetsMacroStabilityInwardsSurfaceLineCollectionProperties)); + typeof(MacroStabilityInwardsSurfaceLinesContext), + typeof(MacroStabilityInwardsSurfaceLineCollectionProperties)); PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, - typeof(RingtoetsMacroStabilityInwardsSurfaceLine), - typeof(RingtoetsMacroStabilityInwardsSurfaceLineProperties)); + typeof(MacroStabilityInwardsSurfaceLine), + typeof(MacroStabilityInwardsSurfaceLineProperties)); PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, @@ -112,8 +112,8 @@ // Assert Assert.AreEqual(13, treeNodeInfos.Length); - Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(RingtoetsMacroStabilityInwardsSurfaceLinesContext))); - Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(RingtoetsMacroStabilityInwardsSurfaceLine))); + Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(MacroStabilityInwardsSurfaceLinesContext))); + Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(MacroStabilityInwardsSurfaceLine))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(StochasticSoilModelCollectionContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(StochasticSoilModel))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(StochasticSoilProfile))); @@ -159,7 +159,7 @@ // Assert Assert.AreEqual(2, updateInfos.Length); - Assert.AreEqual(1, updateInfos.Count(updateInfo => updateInfo.DataType == typeof(RingtoetsMacroStabilityInwardsSurfaceLinesContext))); + Assert.AreEqual(1, updateInfos.Count(updateInfo => updateInfo.DataType == typeof(MacroStabilityInwardsSurfaceLinesContext))); Assert.AreEqual(1, updateInfos.Count(updateInfo => updateInfo.DataType == typeof(StochasticSoilModelCollectionContext))); } } @@ -175,7 +175,7 @@ // Assert Assert.AreEqual(3, importInfos.Length); - Assert.IsTrue(importInfos.Any(i => i.DataType == typeof(RingtoetsMacroStabilityInwardsSurfaceLinesContext))); + Assert.IsTrue(importInfos.Any(i => i.DataType == typeof(MacroStabilityInwardsSurfaceLinesContext))); Assert.IsTrue(importInfos.Any(i => i.DataType == typeof(StochasticSoilModelCollectionContext))); Assert.IsTrue(importInfos.Any(i => i.DataType == typeof(MacroStabilityInwardsCalculationGroupContext))); } Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/PropertyInfos/MacroStabilityInwardsInputContextPropertyInfoTest.cs =================================================================== diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/PropertyInfos/MacroStabilityInwardsInputContextPropertyInfoTest.cs (.../MacroStabilityInwardsInputContextPropertyInfoTest.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/PropertyInfos/MacroStabilityInwardsInputContextPropertyInfoTest.cs (.../MacroStabilityInwardsInputContextPropertyInfoTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -73,7 +73,7 @@ var context = new MacroStabilityInwardsInputContext( scenario.InputParameters, scenario, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/PropertyInfos/MacroStabilityInwardsSurfaceLineCollectionContextPropertyInfoTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/PropertyInfos/MacroStabilityInwardsSurfaceLineCollectionContextPropertyInfoTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/PropertyInfos/MacroStabilityInwardsSurfaceLineCollectionContextPropertyInfoTest.cs (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -0,0 +1,84 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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.Linq; +using Core.Common.Gui.Plugin; +using Core.Common.Gui.PropertyBag; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.MacroStabilityInwards.Forms.PresentationObjects; +using Ringtoets.MacroStabilityInwards.Forms.PropertyClasses; + +namespace Ringtoets.MacroStabilityInwards.Plugin.Test.PropertyInfos +{ + [TestFixture] + public class MacroStabilityInwardsSurfaceLineCollectionContextPropertyInfoTest + { + private MacroStabilityInwardsPlugin plugin; + private PropertyInfo info; + + [SetUp] + public void SetUp() + { + plugin = new MacroStabilityInwardsPlugin(); + info = plugin.GetPropertyInfos().First(tni => tni.PropertyObjectType == typeof(MacroStabilityInwardsSurfaceLineCollectionProperties)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(MacroStabilityInwardsSurfaceLinesContext), info.DataType); + Assert.AreEqual(typeof(MacroStabilityInwardsSurfaceLineCollectionProperties), info.PropertyObjectType); + } + + [Test] + public void CreateInstance_Always_NewPropertiesWithInputContextAsData() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + + var collection = new MacroStabilityInwardsSurfaceLineCollection(); + var context = new MacroStabilityInwardsSurfaceLinesContext(collection, failureMechanism, assessmentSection); + + // Call + IObjectProperties objectProperties = info.CreateInstance(context); + + // Assert + Assert.IsInstanceOf(objectProperties); + Assert.AreSame(collection, objectProperties.Data); + + mocks.VerifyAll(); + } + } +} \ No newline at end of file Fisheye: Tag cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/PropertyInfos/RingtoetsMacroStabilityInwardsSurfaceLineCollectionContextPropertyInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/Ringtoets.MacroStabilityInwards.Plugin.Test.csproj =================================================================== diff -u -ra940166534b3dd6e778de2e7c8e7e5241f3d3381 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/Ringtoets.MacroStabilityInwards.Plugin.Test.csproj (.../Ringtoets.MacroStabilityInwards.Plugin.Test.csproj) (revision a940166534b3dd6e778de2e7c8e7e5241f3d3381) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/Ringtoets.MacroStabilityInwards.Plugin.Test.csproj (.../Ringtoets.MacroStabilityInwards.Plugin.Test.csproj) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -73,11 +73,11 @@ - + - + @@ -89,12 +89,12 @@ - - + + - + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r92210258706d0f57e05552037b676bd941a6fe19 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsCalculationGroupContextTreeNodeInfoTest.cs (.../MacroStabilityInwardsCalculationGroupContextTreeNodeInfoTest.cs) (revision 92210258706d0f57e05552037b676bd941a6fe19) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsCalculationGroupContextTreeNodeInfoTest.cs (.../MacroStabilityInwardsCalculationGroupContextTreeNodeInfoTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -137,7 +137,7 @@ mocks.ReplayAll(); var groupContext = new MacroStabilityInwardsCalculationGroupContext(group, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -170,7 +170,7 @@ mocks.ReplayAll(); var nodeData = new MacroStabilityInwardsCalculationGroupContext(group, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -206,12 +206,12 @@ var failureMechanism = new TestMacroStabilityInwardsFailureMechanism(); var assessmentSection = mocks.Stub(); var nodeData = new MacroStabilityInwardsCalculationGroupContext(group, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); var parentNodeData = new MacroStabilityInwardsCalculationGroupContext(parentGroup, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -328,7 +328,7 @@ var failureMechanism = new TestMacroStabilityInwardsFailureMechanism(); var assessmentSection = mocks.Stub(); var nodeData = new MacroStabilityInwardsCalculationGroupContext(group, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -441,7 +441,7 @@ var assessmentSection = mocks.Stub(); var nodeData = new MacroStabilityInwardsCalculationGroupContext(group, - Enumerable.Empty(), + Enumerable.Empty(), new[] { new TestStochasticSoilModel() @@ -483,7 +483,7 @@ var nodeData = new MacroStabilityInwardsCalculationGroupContext(group, new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine() + new MacroStabilityInwardsSurfaceLine() }, Enumerable.Empty(), failureMechanism, @@ -525,7 +525,7 @@ var nodeData = new MacroStabilityInwardsCalculationGroupContext(group, new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine() + new MacroStabilityInwardsSurfaceLine() }, new[] { @@ -572,7 +572,7 @@ }; var nodeData = new MacroStabilityInwardsCalculationGroupContext(group, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -621,7 +621,7 @@ }; var nodeData = new MacroStabilityInwardsCalculationGroupContext(group, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -662,12 +662,12 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); var assessmentSection = mocks.Stub(); var nodeData = new MacroStabilityInwardsCalculationGroupContext(group, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); var parentNodeData = new MacroStabilityInwardsCalculationGroupContext(parentGroup, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -720,12 +720,12 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); var assessmentSection = mocks.Stub(); var nodeData = new MacroStabilityInwardsCalculationGroupContext(group, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); var parentNodeData = new MacroStabilityInwardsCalculationGroupContext(parentGroup, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -793,12 +793,12 @@ var assessmentSection = mocks.Stub(); var nodeData = new MacroStabilityInwardsCalculationGroupContext(group, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); var parentNodeData = new MacroStabilityInwardsCalculationGroupContext(parentGroup, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -859,12 +859,12 @@ IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStubWithoutBoundaryDatabase( failureMechanism, mocks); var nodeData = new MacroStabilityInwardsCalculationGroupContext(group, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSectionStub); var parentNodeData = new MacroStabilityInwardsCalculationGroupContext(parentGroup, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSectionStub); @@ -935,12 +935,12 @@ failureMechanism, mocks); var nodeData = new MacroStabilityInwardsCalculationGroupContext(group, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSectionStub); var parentNodeData = new MacroStabilityInwardsCalculationGroupContext(parentGroup, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSectionStub); @@ -999,11 +999,11 @@ var surfaceLines = new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = "surfaceLine1" }, - new RingtoetsMacroStabilityInwardsSurfaceLine + new MacroStabilityInwardsSurfaceLine { Name = "surfaceLine2" } @@ -1060,7 +1060,7 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); var assessmentSection = mocks.Stub(); - var surfaceLine1 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine1 = new MacroStabilityInwardsSurfaceLine { Name = "Surface line 1", ReferenceLineIntersectionWorldPoint = new Point2D(0.0, 0.0) @@ -1073,7 +1073,7 @@ new Point3D(0.0, -5.0, 0.0) }); - var surfaceLine2 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine2 = new MacroStabilityInwardsSurfaceLine { Name = "Surface line 2", ReferenceLineIntersectionWorldPoint = new Point2D(5.0, 0.0) @@ -1172,7 +1172,7 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); var assessmentSection = mocks.Stub(); - var surfaceLine1 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine1 = new MacroStabilityInwardsSurfaceLine { Name = "Surface line 1", ReferenceLineIntersectionWorldPoint = new Point2D(0.0, 0.0) @@ -1185,7 +1185,7 @@ new Point3D(0.0, -5.0, 0.0) }); - var surfaceLine2 = new RingtoetsMacroStabilityInwardsSurfaceLine + var surfaceLine2 = new MacroStabilityInwardsSurfaceLine { Name = "Surface line 2", ReferenceLineIntersectionWorldPoint = new Point2D(5.0, 0.0) @@ -1283,15 +1283,15 @@ mocks.ReplayAll(); var nodeData = new MacroStabilityInwardsCalculationGroupContext(group, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); var parentGroup = new CalculationGroup(); parentGroup.Children.Add(group); var parentNodeData = new MacroStabilityInwardsCalculationGroupContext(parentGroup, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -1315,7 +1315,7 @@ observer.Expect(o => o.UpdateObserver()); var group = new CalculationGroup(); TestMacroStabilityInwardsFailureMechanism macroStabilityInwardsFailureMechanism = TestMacroStabilityInwardsFailureMechanism.GetFailureMechanismWithSurfaceLinesAndStochasticSoilModels(); - RingtoetsMacroStabilityInwardsSurfaceLine[] surfaceLines = macroStabilityInwardsFailureMechanism.SurfaceLines.ToArray(); + MacroStabilityInwardsSurfaceLine[] surfaceLines = macroStabilityInwardsFailureMechanism.SurfaceLines.ToArray(); var calculation = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()) { @@ -1331,15 +1331,15 @@ mocks.ReplayAll(); var nodeData = new MacroStabilityInwardsCalculationGroupContext(group, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), macroStabilityInwardsFailureMechanism, assessmentSection); CalculationGroup parentGroup = macroStabilityInwardsFailureMechanism.CalculationsGroup; parentGroup.Children.Add(group); var parentNodeData = new MacroStabilityInwardsCalculationGroupContext(parentGroup, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), macroStabilityInwardsFailureMechanism, assessmentSection); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsCalculationScenarioContextTreeNodeInfoTest.cs =================================================================== diff -u -r92210258706d0f57e05552037b676bd941a6fe19 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsCalculationScenarioContextTreeNodeInfoTest.cs (.../MacroStabilityInwardsCalculationScenarioContextTreeNodeInfoTest.cs) (revision 92210258706d0f57e05552037b676bd941a6fe19) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsCalculationScenarioContextTreeNodeInfoTest.cs (.../MacroStabilityInwardsCalculationScenarioContextTreeNodeInfoTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -133,7 +133,7 @@ var calculationContext = new MacroStabilityInwardsCalculationScenarioContext(calculation, new[] { - new RingtoetsMacroStabilityInwardsSurfaceLine() + new MacroStabilityInwardsSurfaceLine() }, new[] { @@ -169,7 +169,7 @@ mocks.ReplayAll(); var calculationContext = new MacroStabilityInwardsCalculationScenarioContext(new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()), - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -200,7 +200,7 @@ var failureMechanism = new TestMacroStabilityInwardsFailureMechanism(); var assessmentSection = mocks.Stub(); var nodeData = new MacroStabilityInwardsCalculationScenarioContext(calculation, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -239,7 +239,7 @@ var failureMechanism = new TestMacroStabilityInwardsFailureMechanism(); var assessmentSection = mocks.Stub(); var nodeData = new MacroStabilityInwardsCalculationScenarioContext(calculation, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -273,7 +273,7 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); var assessmentSection = mocks.Stub(); var nodeData = new MacroStabilityInwardsCalculationScenarioContext(calculation, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -316,7 +316,7 @@ var failureMechanism = new TestMacroStabilityInwardsFailureMechanism(); var assessmentSection = mocks.Stub(); var nodeData = new MacroStabilityInwardsCalculationScenarioContext(calculation, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -355,7 +355,7 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); var assessmentSection = mocks.Stub(); var nodeData = new MacroStabilityInwardsCalculationScenarioContext(new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()), - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -415,12 +415,12 @@ mocks.ReplayAll(); var calculationContext = new MacroStabilityInwardsCalculationScenarioContext(elementToBeRemoved, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); var groupContext = new MacroStabilityInwardsCalculationGroupContext(group, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -447,7 +447,7 @@ observer.Expect(o => o.UpdateObserver()); TestMacroStabilityInwardsFailureMechanism macroStabilityInwardsFailureMechanism = TestMacroStabilityInwardsFailureMechanism.GetFailureMechanismWithSurfaceLinesAndStochasticSoilModels(); - RingtoetsMacroStabilityInwardsSurfaceLine[] surfaceLines = macroStabilityInwardsFailureMechanism.SurfaceLines.ToArray(); + MacroStabilityInwardsSurfaceLine[] surfaceLines = macroStabilityInwardsFailureMechanism.SurfaceLines.ToArray(); var elementToBeRemoved = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()) { @@ -467,12 +467,12 @@ mocks.ReplayAll(); var calculationContext = new MacroStabilityInwardsCalculationScenarioContext(elementToBeRemoved, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), macroStabilityInwardsFailureMechanism, assessmentSection); var groupContext = new MacroStabilityInwardsCalculationGroupContext(group, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), macroStabilityInwardsFailureMechanism, assessmentSection); @@ -507,7 +507,7 @@ IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStubWithoutBoundaryDatabase( failureMechanism, mocks); var calculationContext = new MacroStabilityInwardsCalculationScenarioContext(calculation, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSectionStub); @@ -573,7 +573,7 @@ var assessmentSection = mocks.Stub(); var calculationContext = new MacroStabilityInwardsCalculationScenarioContext(calculation, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -620,7 +620,7 @@ failureMechanism, mocks); var calculationContext = new MacroStabilityInwardsCalculationScenarioContext(calculation, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSectionStub); @@ -686,7 +686,7 @@ var assessmentSection = mocks.Stub(); var calculationContext = new MacroStabilityInwardsCalculationScenarioContext(calculation, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -r92210258706d0f57e05552037b676bd941a6fe19 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsFailureMechanismContextTreeNodeInfoTest.cs (.../MacroStabilityInwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision 92210258706d0f57e05552037b676bd941a6fe19) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsFailureMechanismContextTreeNodeInfoTest.cs (.../MacroStabilityInwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -163,7 +163,7 @@ Assert.AreSame(failureMechanism, failureMechanismSectionsContext.WrappedData); Assert.AreSame(assessmentSection, failureMechanismSectionsContext.ParentAssessmentSection); - var surfaceLinesContext = (RingtoetsMacroStabilityInwardsSurfaceLinesContext) inputsFolder.Contents[1]; + var surfaceLinesContext = (MacroStabilityInwardsSurfaceLinesContext) inputsFolder.Contents[1]; Assert.AreSame(failureMechanism.SurfaceLines, surfaceLinesContext.WrappedData); Assert.AreSame(failureMechanism, surfaceLinesContext.FailureMechanism); Assert.AreSame(assessmentSection, surfaceLinesContext.AssessmentSection); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsInputContextTreeNodeInfoTest.cs =================================================================== diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsInputContextTreeNodeInfoTest.cs (.../MacroStabilityInwardsInputContextTreeNodeInfoTest.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsInputContextTreeNodeInfoTest.cs (.../MacroStabilityInwardsInputContextTreeNodeInfoTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -91,7 +91,7 @@ var context = new MacroStabilityInwardsInputContext( new MacroStabilityInwardsInput(new GeneralMacroStabilityInwardsInput()), new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()), - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), new MacroStabilityInwardsFailureMechanism(), mocks.Stub()); @@ -112,7 +112,7 @@ var context = new MacroStabilityInwardsInputContext( new MacroStabilityInwardsInput(new GeneralMacroStabilityInwardsInput()), new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()), - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), new MacroStabilityInwardsFailureMechanism(), mocks.Stub()); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsSurfaceLineCollectionTreeNodeInfoTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsSurfaceLineCollectionTreeNodeInfoTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsSurfaceLineCollectionTreeNodeInfoTest.cs (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -0,0 +1,245 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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.Drawing; +using System.Linq; +using Core.Common.Controls.TreeView; +using Core.Common.Gui; +using Core.Common.Gui.ContextMenu; +using Core.Common.TestUtil; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.MacroStabilityInwards.Forms.PresentationObjects; +using Ringtoets.MacroStabilityInwards.Primitives; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.MacroStabilityInwards.Plugin.Test.TreeNodeInfos +{ + [TestFixture] + public class MacroStabilityInwardsSurfaceLineCollectionTreeNodeInfoTest + { + private MockRepository mocks; + private MacroStabilityInwardsPlugin plugin; + private TreeNodeInfo info; + + [SetUp] + public void SetUp() + { + mocks = new MockRepository(); + plugin = new MacroStabilityInwardsPlugin(); + info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(MacroStabilityInwardsSurfaceLinesContext)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + mocks.VerifyAll(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Setup + mocks.ReplayAll(); + + // Assert + Assert.IsNotNull(info.Text); + Assert.IsNotNull(info.ForeColor); + Assert.IsNotNull(info.Image); + Assert.IsNotNull(info.ContextMenuStrip); + Assert.IsNull(info.EnsureVisibleOnCreate); + Assert.IsNull(info.ExpandOnCreate); + Assert.IsNotNull(info.ChildNodeObjects); + Assert.IsNull(info.CanRename); + Assert.IsNull(info.OnNodeRenamed); + Assert.IsNull(info.CanRemove); + Assert.IsNull(info.OnNodeRemoved); + Assert.IsNull(info.CanCheck); + Assert.IsNull(info.IsChecked); + Assert.IsNull(info.OnNodeChecked); + Assert.IsNull(info.CanDrag); + Assert.IsNull(info.CanDrop); + Assert.IsNull(info.CanInsert); + Assert.IsNull(info.OnDrop); + } + + [Test] + public void Text_Always_ReturnsTextFromResource() + { + // Setup + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + var surfaceLinesContext = new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection); + + // Call + string text = info.Text(surfaceLinesContext); + + // Assert + Assert.AreEqual("Profielschematisaties", text); + } + + [Test] + public void Image_Always_ReturnsSetImage() + { + // Setup + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + var surfaceLinesContext = new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection); + + // Call + Image image = info.Image(surfaceLinesContext); + + // Assert + TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.GeneralFolderIcon, image); + } + + [Test] + public void ForeColor_CollectionWithoutSurfaceLines_ReturnsGrayText() + { + // Setup + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + var surfaceLinesContext = new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection); + + // Call + Color foreColor = info.ForeColor(surfaceLinesContext); + + // Assert + Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), foreColor); + } + + [Test] + public void ForeColor_CollectionWithSurfaceLines_ReturnsControlText() + { + // Setup + var assessmentSection = mocks.Stub(); + var surfaceLine1 = new MacroStabilityInwardsSurfaceLine + { + Name = "Line A" + }; + var surfaceLine2 = new MacroStabilityInwardsSurfaceLine + { + Name = "Line B" + }; + + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + surfaceLines.AddRange(new[] + { + surfaceLine1, + surfaceLine2 + }, "path"); + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + + var surfaceLinesContext = new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection); + + mocks.ReplayAll(); + + // Call + Color foreColor = info.ForeColor(surfaceLinesContext); + + // Assert + Assert.AreEqual(Color.FromKnownColor(KnownColor.ControlText), foreColor); + } + + [Test] + public void ChildNodeObjects_Always_ReturnsChildrenOfData() + { + // Setup + var assessmentSection = mocks.Stub(); + var surfaceLine1 = new MacroStabilityInwardsSurfaceLine + { + Name = "Line A" + }; + var surfaceLine2 = new MacroStabilityInwardsSurfaceLine + { + Name = "Line B" + }; + + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + surfaceLines.AddRange(new[] + { + surfaceLine1, + surfaceLine2 + }, "path"); + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + + var surfaceLinesContext = new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection); + + mocks.ReplayAll(); + + // Call + object[] objects = info.ChildNodeObjects(surfaceLinesContext); + + // Assert + CollectionAssert.AreEqual(new[] + { + surfaceLine1, + surfaceLine2 + }, objects); + } + + [Test] + public void ContextMenuStrip_Always_CallsBuilder() + { + // Setup + var menuBuilderMock = mocks.StrictMock(); + using (mocks.Ordered()) + { + menuBuilderMock.Expect(mb => mb.AddImportItem()).Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.AddUpdateItem()).Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.AddSeparator()).Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.AddCollapseAllItem()).Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.AddExpandAllItem()).Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.AddSeparator()).Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.AddPropertiesItem()).Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.Build()).Return(null); + } + + using (var treeViewControl = new TreeViewControl()) + { + var gui = mocks.Stub(); + gui.Stub(g => g.Get(null, treeViewControl)).Return(menuBuilderMock); + mocks.ReplayAll(); + + plugin.Gui = gui; + + // Call + info.ContextMenuStrip(null, null, treeViewControl); + } + // Assert + // Assert expectancies are called in TearDown() + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsSurfaceLineTreeNodeInfoTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsSurfaceLineTreeNodeInfoTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsSurfaceLineTreeNodeInfoTest.cs (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -0,0 +1,141 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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.Drawing; +using System.Linq; +using Core.Common.Controls.TreeView; +using Core.Common.Gui; +using Core.Common.Gui.ContextMenu; +using Core.Common.TestUtil; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.MacroStabilityInwards.Forms.Properties; +using Ringtoets.MacroStabilityInwards.Primitives; + +namespace Ringtoets.MacroStabilityInwards.Plugin.Test.TreeNodeInfos +{ + [TestFixture] + public class MacroStabilityInwardsSurfaceLineTreeNodeInfoTest + { + private MockRepository mocks; + private MacroStabilityInwardsPlugin plugin; + private TreeNodeInfo info; + + [SetUp] + public void SetUp() + { + mocks = new MockRepository(); + plugin = new MacroStabilityInwardsPlugin(); + info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(MacroStabilityInwardsSurfaceLine)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + mocks.VerifyAll(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Setup + mocks.ReplayAll(); + + // Assert + Assert.IsNotNull(info.Text); + Assert.IsNull(info.ForeColor); + Assert.IsNotNull(info.Image); + Assert.IsNotNull(info.ContextMenuStrip); + Assert.IsNull(info.EnsureVisibleOnCreate); + Assert.IsNull(info.ExpandOnCreate); + Assert.IsNull(info.ChildNodeObjects); + Assert.IsNull(info.CanRename); + Assert.IsNull(info.OnNodeRenamed); + Assert.IsNull(info.CanRemove); + Assert.IsNull(info.OnNodeRemoved); + Assert.IsNull(info.CanCheck); + Assert.IsNull(info.IsChecked); + Assert.IsNull(info.OnNodeChecked); + Assert.IsNull(info.CanDrag); + Assert.IsNull(info.CanDrop); + Assert.IsNull(info.CanInsert); + Assert.IsNull(info.OnDrop); + } + + [Test] + public void Text_Always_ReturnsName() + { + // Setup + var surfaceLine = mocks.StrictMock(); + const string testName = "ttt"; + surfaceLine.Name = testName; + + mocks.ReplayAll(); + + // Call + string text = info.Text(surfaceLine); + + // Assert + Assert.AreEqual(testName, text); + } + + [Test] + public void Image_Always_ReturnsSetImage() + { + // Setup + var surfaceLine = mocks.StrictMock(); + + mocks.ReplayAll(); + + // Call + Image image = info.Image(surfaceLine); + + // Assert + TestHelper.AssertImagesAreEqual(Resources.SurfaceLineIcon, image); + } + + [Test] + public void ContextMenuStrip_Always_CallsBuilder() + { + // Setup + var menuBuilderMock = mocks.StrictMock(); + + menuBuilderMock.Expect(mb => mb.AddSeparator()).Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.AddPropertiesItem()).Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.Build()).Return(null); + + using (var treeViewControl = new TreeViewControl()) + { + var gui = mocks.Stub(); + gui.Stub(g => g.Get(null, treeViewControl)).Return(menuBuilderMock); + mocks.ReplayAll(); + + plugin.Gui = gui; + + // Call + info.ContextMenuStrip(null, null, treeViewControl); + } + // Assert + // Assert expectancies are called in TearDown() + } + } +} \ No newline at end of file Fisheye: Tag cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/RingtoetsMacroStabilityInwardsSurfaceLineCollectionTreeNodeInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/RingtoetsMacroStabilityInwardsSurfaceLineTreeNodeInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/UpdateInfos/MacroStabilityInwardsSurfaceLinesContextUpdateInfoTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/UpdateInfos/MacroStabilityInwardsSurfaceLinesContextUpdateInfoTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/UpdateInfos/MacroStabilityInwardsSurfaceLinesContextUpdateInfoTest.cs (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -0,0 +1,275 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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.Drawing; +using System.Linq; +using Core.Common.Base.IO; +using Core.Common.Gui; +using Core.Common.Gui.Forms.MainWindow; +using Core.Common.Gui.Plugin; +using Core.Common.TestUtil; +using NUnit.Extensions.Forms; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.IO.SurfaceLines; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.MacroStabilityInwards.Forms.PresentationObjects; +using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil; +using Ringtoets.MacroStabilityInwards.Primitives; +using FormsResources = Ringtoets.MacroStabilityInwards.Forms.Properties.Resources; + +namespace Ringtoets.MacroStabilityInwards.Plugin.Test.UpdateInfos +{ + [TestFixture] + public class MacroStabilityInwardsSurfaceLinesContextUpdateInfoTest : NUnitFormTest + { + private UpdateInfo updateInfo; + private MacroStabilityInwardsPlugin plugin; + + public override void Setup() + { + plugin = new MacroStabilityInwardsPlugin(); + updateInfo = plugin.GetUpdateInfos().First(i => i.DataType == typeof(MacroStabilityInwardsSurfaceLinesContext)); + } + + public override void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Name_Always_ReturnExpectedName() + { + // Call + string name = updateInfo.Name; + + // Assert + Assert.AreEqual("Profielschematisaties", name); + } + + [Test] + public void Category_Always_ReturnExpectedCategory() + { + // Call + string category = updateInfo.Category; + + // Assert + Assert.AreEqual("Algemeen", category); + } + + [Test] + public void Image_Always_ReturnExpectedIcon() + { + // Call + Image image = updateInfo.Image; + + // Assert + TestHelper.AssertImagesAreEqual(FormsResources.SurfaceLineIcon, image); + } + + [Test] + public void IsEnabled_SurfaceLineCollectionSourcePathNull_ReturnFalse() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + + var context = new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection); + + // Call + bool isEnabled = updateInfo.IsEnabled(context); + + // Assert + Assert.IsFalse(isEnabled); + mocks.VerifyAll(); + } + + [Test] + public void IsEnabled_SurfaceLineCollectionSourcePathSet_ReturnTrue() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + surfaceLines.AddRange(Enumerable.Empty(), "some/path"); + + var context = new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection); + + // Call + bool isEnabled = updateInfo.IsEnabled(context); + + // Assert + Assert.IsTrue(isEnabled); + mocks.VerifyAll(); + } + + [Test] + public void FileFilterGenerator_Always_ReturnExpectedFileFilter() + { + // Call + string fileFilter = updateInfo.FileFilterGenerator.Filter; + + // Assert + Assert.AreEqual("Profielschematisaties Kommagescheiden bestand (*.csv)|*.csv", fileFilter); + } + + [Test] + public void VerifyUpdates_CalculationWithoutOutputs_ReturnsTrue() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + + var mainWindow = mocks.Stub(); + var gui = mocks.Stub(); + gui.Stub(g => g.MainWindow).Return(mainWindow); + mocks.ReplayAll(); + + plugin.Gui = gui; + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + failureMechanism.CalculationsGroup.Children.Add(new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput())); + + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + var context = new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection); + + // Call + bool updatesVerified = updateInfo.VerifyUpdates(context); + + // Assert + Assert.IsTrue(updatesVerified); + mocks.VerifyAll(); + } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void VerifyUpdates_CalculationWithOutputs_AlwaysReturnsExpectedInquiryMessage(bool isActionConfirmed) + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + + var mainWindow = mocks.Stub(); + var gui = mocks.Stub(); + gui.Stub(g => g.MainWindow).Return(mainWindow); + mocks.ReplayAll(); + + plugin.Gui = gui; + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + var calculationWithOutput = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()) + { + Output = new TestMacroStabilityInwardsOutput() + }; + failureMechanism.CalculationsGroup.Children.Add(calculationWithOutput); + + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + var context = new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection); + + string textBoxMessage = null; + DialogBoxHandler = (name, wnd) => + { + var helper = new MessageBoxTester(wnd); + textBoxMessage = helper.Text; + + if (isActionConfirmed) + { + helper.ClickOk(); + } + else + { + helper.ClickCancel(); + } + }; + + // Call + bool updatesVerified = updateInfo.VerifyUpdates(context); + + // Assert + string expectedInquiryMessage = "Als profielschematisaties wijzigen door het bijwerken, " + + "dan worden de resultaten van berekeningen die deze profielschematisaties gebruiken " + + $"verwijderd.{Environment.NewLine}{Environment.NewLine}Weet u zeker dat u wilt doorgaan?"; + Assert.AreEqual(expectedInquiryMessage, textBoxMessage); + Assert.AreEqual(isActionConfirmed, updatesVerified); + mocks.VerifyAll(); + } + + [Test] + public void CurrentPath_SurfaceLineCollectionHasPathSet_ReturnsExpectedPath() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + const string expectedFilePath = "some/path"; + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + surfaceLines.AddRange(new[] + { + new MacroStabilityInwardsSurfaceLine() + }, expectedFilePath); + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + + var context = new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection); + + // Call + string currentPath = updateInfo.CurrentPath(context); + + // Assert + Assert.AreEqual(expectedFilePath, currentPath); + mocks.VerifyAll(); + } + + [Test] + public void CreateFileImporter_ValidInput_ReturnFileImporter() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + assessmentSection.ReferenceLine = new ReferenceLine(); + + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + var surfaceLines = new MacroStabilityInwardsSurfaceLineCollection(); + + var importTarget = new MacroStabilityInwardsSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection); + + // Call + IFileImporter importer = updateInfo.CreateFileImporter(importTarget, ""); + + // Assert + Assert.IsInstanceOf>(importer); + mocks.VerifyAll(); + } + } +} \ No newline at end of file Fisheye: Tag cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/UpdateInfos/RingtoetsMacroStabilityInwardsSurfaceLinesContextUpdateInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsCalculationsViewInfoTest.cs =================================================================== diff -u -r72855f408ad900220c30e399d15854ca7562d4f2 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsCalculationsViewInfoTest.cs (.../MacroStabilityInwardsCalculationsViewInfoTest.cs) (revision 72855f408ad900220c30e399d15854ca7562d4f2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsCalculationsViewInfoTest.cs (.../MacroStabilityInwardsCalculationsViewInfoTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -76,7 +76,7 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); var calculationGroup = new CalculationGroup(); var calculationGroupContext = new MacroStabilityInwardsCalculationGroupContext(calculationGroup, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -115,7 +115,7 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); var calculationGroupContext = new MacroStabilityInwardsCalculationGroupContext(failureMechanism.CalculationsGroup, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -138,7 +138,7 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); var calculationGroup = new CalculationGroup(); var calculationGroupContext = new MacroStabilityInwardsCalculationGroupContext(calculationGroup, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), failureMechanism, assessmentSection); @@ -309,7 +309,7 @@ var assessmentSection = mocks.Stub(); var failureMechanismMock = mocks.StrictMock(); var calculationsGroupMock = mocks.StrictMock(); - var calculationGroupContext = new MacroStabilityInwardsCalculationGroupContext(calculationsGroupMock, Enumerable.Empty(), Enumerable.Empty(), failureMechanismMock, assessmentSection); + var calculationGroupContext = new MacroStabilityInwardsCalculationGroupContext(calculationsGroupMock, Enumerable.Empty(), Enumerable.Empty(), failureMechanismMock, assessmentSection); viewMock.Expect(v => v.AssessmentSection = assessmentSection); viewMock.Expect(v => v.MacroStabilityInwardsFailureMechanism = failureMechanismMock); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsInputViewInfoTest.cs =================================================================== diff -u -r72855f408ad900220c30e399d15854ca7562d4f2 -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsInputViewInfoTest.cs (.../MacroStabilityInwardsInputViewInfoTest.cs) (revision 72855f408ad900220c30e399d15854ca7562d4f2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsInputViewInfoTest.cs (.../MacroStabilityInwardsInputViewInfoTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -90,7 +90,7 @@ var input = new MacroStabilityInwardsInput(new GeneralMacroStabilityInwardsInput()); var calculation = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()); - var calculationInputContext = new MacroStabilityInwardsInputContext(input, calculation, Enumerable.Empty(), + var calculationInputContext = new MacroStabilityInwardsInputContext(input, calculation, Enumerable.Empty(), Enumerable.Empty(), new MacroStabilityInwardsFailureMechanism(), assessmentSection); @@ -112,7 +112,7 @@ var calculation = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()); var calculationScenarioContext = new MacroStabilityInwardsCalculationScenarioContext(calculation, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), new MacroStabilityInwardsFailureMechanism(), assessmentSection); @@ -142,7 +142,7 @@ var calculationToRemove = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()); var calculationScenarioContext = new MacroStabilityInwardsCalculationScenarioContext(calculationToRemove, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), new MacroStabilityInwardsFailureMechanism(), assessmentSection); @@ -173,7 +173,7 @@ calculationGroup.Children.Add(calculation); var calculationGroupContext = new MacroStabilityInwardsCalculationGroupContext(calculationGroup, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), new MacroStabilityInwardsFailureMechanism(), assessmentSection); @@ -203,7 +203,7 @@ calculationGroup.Children.Add(calculation); var calculationGroupContext = new MacroStabilityInwardsCalculationGroupContext(new CalculationGroup(), - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), new MacroStabilityInwardsFailureMechanism(), assessmentSection); @@ -235,7 +235,7 @@ calculationGroup.Children.Add(nestedGroup); var calculationGroupContext = new MacroStabilityInwardsCalculationGroupContext(calculationGroup, - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), new MacroStabilityInwardsFailureMechanism(), assessmentSection); @@ -267,7 +267,7 @@ calculationGroup.Children.Add(nestedGroup); var calculationGroupContext = new MacroStabilityInwardsCalculationGroupContext(new CalculationGroup(), - Enumerable.Empty(), + Enumerable.Empty(), Enumerable.Empty(), new MacroStabilityInwardsFailureMechanism(), assessmentSection); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Exceptions/MacroStabilityInwardsSurfaceLineExceptionTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Exceptions/MacroStabilityInwardsSurfaceLineExceptionTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Exceptions/MacroStabilityInwardsSurfaceLineExceptionTest.cs (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -0,0 +1,32 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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 Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.Primitives.Exceptions; + +namespace Ringtoets.MacroStabilityInwards.Primitives.Test.Exceptions +{ + [TestFixture] + public class MacroStabilityInwardsSurfaceLineExceptionTest : + CustomExceptionDesignGuidelinesTestFixture {} +} \ No newline at end of file Fisheye: Tag cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Exceptions/RingtoetsMacroStabilityInwardsSurfaceLineExceptionTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/MacroStabilityInwardsSurfaceLineTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/MacroStabilityInwardsSurfaceLineTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/MacroStabilityInwardsSurfaceLineTest.cs (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -0,0 +1,1280 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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 System.Linq; +using Core.Common.Base; +using Core.Common.Base.Data; +using Core.Common.Base.Geometry; +using Core.Common.TestUtil; +using Core.Common.Utils; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.Primitives.Exceptions; + +namespace Ringtoets.MacroStabilityInwards.Primitives.Test +{ + [TestFixture] + public class MacroStabilityInwardsSurfaceLineTest + { + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + + // Assert + Assert.IsInstanceOf(surfaceLine); + Assert.IsEmpty(surfaceLine.Name); + CollectionAssert.IsEmpty(surfaceLine.Points); + Assert.IsNull(surfaceLine.StartingWorldPoint); + Assert.IsNull(surfaceLine.EndingWorldPoint); + Assert.IsNull(surfaceLine.ReferenceLineIntersectionWorldPoint); + } + + [Test] + public void ReferenceLineIntersectionWorldPoint_SetNewValue_GetNewlySetValue() + { + // Setup + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + + var point = new Point2D(1.2, 3.4); + + // Call + surfaceLine.ReferenceLineIntersectionWorldPoint = point; + + // Assert + Assert.AreEqual(point, surfaceLine.ReferenceLineIntersectionWorldPoint); + } + + [Test] + public void SetGeometry_EmptyCollection_PointsSetEmptyAndNullStartAndEndWorldPoints() + { + // Setup + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + + IEnumerable sourceData = Enumerable.Empty(); + + // Call + surfaceLine.SetGeometry(sourceData); + + // Assert + CollectionAssert.IsEmpty(surfaceLine.Points); + Assert.IsNull(surfaceLine.StartingWorldPoint); + Assert.IsNull(surfaceLine.EndingWorldPoint); + } + + [Test] + public void SetGeometry_CollectionOfOnePoint_InitializeStartAndEndWorldPointsToSameInstanceAndInitializePoints() + { + // Setup + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + + var sourceData = new[] + { + new Point3D(1.1, 2.2, 3.3) + }; + + // Call + surfaceLine.SetGeometry(sourceData); + + // Assert + Assert.AreNotSame(sourceData, surfaceLine.Points); + CollectionAssert.AreEqual(sourceData, surfaceLine.Points); + TestHelper.AssertAreEqualButNotSame(sourceData[0], surfaceLine.StartingWorldPoint); + TestHelper.AssertAreEqualButNotSame(sourceData[0], surfaceLine.EndingWorldPoint); + } + + [Test] + public void SetGeometry_CollectionOfMultiplePoints_InitializeStartAndEndWorldPointsInitializePoints() + { + // Setup + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + + var sourceData = new[] + { + new Point3D(1.1, 2.2, 3.3), + new Point3D(4.4, 5.5, 6.6), + new Point3D(7.7, 8.8, 9.9), + new Point3D(10.10, 11.11, 12.12) + }; + + // Call + surfaceLine.SetGeometry(sourceData); + + // Assert + Assert.AreNotSame(sourceData, surfaceLine.Points); + CollectionAssert.AreEqual(sourceData, surfaceLine.Points); + TestHelper.AssertAreEqualButNotSame(sourceData[0], surfaceLine.StartingWorldPoint); + TestHelper.AssertAreEqualButNotSame(sourceData[3], surfaceLine.EndingWorldPoint); + } + + [Test] + public void SetGeometry_GeometryIsNull_ThrowsArgumentNullException() + { + // Setup + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + + // Call + TestDelegate test = () => surfaceLine.SetGeometry(null); + + // Assert + var exception = Assert.Throws(test); + StringAssert.StartsWith("De geometrie die opgegeven werd voor de profielschematisatie heeft geen waarde.", exception.Message); + } + + [Test] + public void SetGeometry_GeometryContainsNullPoint_ThrowsArgumentException() + { + // Setup + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + + // Call + TestDelegate test = () => surfaceLine.SetGeometry(new Point3D[] + { + null + }); + + // Assert + var exception = Assert.Throws(test); + StringAssert.StartsWith("Een punt in de geometrie voor de profielschematisatie heeft geen waarde.", exception.Message); + } + + [Test] + public void GetZAtL_GeometryIsEmpty_ThrowsInvalidOperationException() + { + // Setup + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + var l = (RoundedDouble) new Random(21).NextDouble(); + + // Call + TestDelegate test = () => surfaceLine.GetZAtL(l); + + // Assert + string exceptionMessage = Assert.Throws(test).Message; + Assert.AreEqual("De profielschematisatie heeft geen geometrie.", exceptionMessage); + } + + [Test] + public void GetZAtL_SurfaceLineContainsPointAtL_ReturnsZOfPoint() + { + // Setup + double testZ = new Random(22).NextDouble(); + + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + var l = (RoundedDouble) 2.0; + surfaceLine.SetGeometry(new[] + { + new Point3D(0.0, 0.0, 2.2), + new Point3D(l, 0.0, testZ), + new Point3D(3.0, 0.0, 7.7) + }); + + // Call + double result = surfaceLine.GetZAtL(l); + + // Assert + Assert.AreEqual(testZ, result, 1e-2); + } + + [Test] + [SetCulture("nl-NL")] + [TestCase(-1)] + [TestCase(-5e-3)] + [TestCase(3.1 + 5e-3)] + [TestCase(4.0)] + public void GetZAtL_SurfaceLineDoesNotContainsPointAtL_ThrowsArgumentOutOfRangeException(double l) + { + // Setup + double testZ = new Random(22).NextDouble(); + + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + surfaceLine.SetGeometry(new[] + { + new Point3D(1.0, 0.0, 2.2), + new Point3D(2.0, 0.0, testZ), + new Point3D(4.1, 0.0, 7.7) + }); + + // Call + TestDelegate test = () => surfaceLine.GetZAtL((RoundedDouble) l); + + // Assert + const string expectedMessage = "Kan geen hoogte bepalen. De lokale coördinaat moet in het bereik [0,0, 3,1] liggen."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + } + + [Test] + public void GetZAtL_SurfaceLineVerticalAtL_ThrowsMacroStabilityInwardsSurfaceLineException() + { + // Setup + double testZ = new Random(22).NextDouble(); + + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + var l = (RoundedDouble) 2.0; + surfaceLine.SetGeometry(new[] + { + new Point3D(0.0, 0.0, 2.2), + new Point3D(l, 0.0, testZ), + new Point3D(l, 0.0, testZ + 1), + new Point3D(3.0, 0.0, 7.7) + }); + + // Call + TestDelegate test = () => surfaceLine.GetZAtL(l); + + // Assert + var exception = Assert.Throws(test); + string message = $"Kan geen hoogte bepalen op het punt met de lokale coördinaat {l}, omdat de profielschematisatie verticaal loopt op dat punt."; + Assert.AreEqual(message, exception.Message); + } + + [Test] + public void ToString_ReturnName() + { + // Setup + const string niceName = "Nice name"; + var surfaceLine = new MacroStabilityInwardsSurfaceLine + { + Name = niceName + }; + + // Call + string text = surfaceLine.ToString(); + + // Assert + Assert.AreEqual(niceName, text); + } + + [Test] + [TestCase(5.0)] + [TestCase(1.375)] + [TestCase(-0.005)] + [TestCase(-5)] + public void ValidateInRange_PointNotInRange_ReturnsFalse(double invalidValue) + { + // Setup + const double testX = 1.0; + const double testY = 2.2; + const double testZ = 4.4; + var testPoint = new Point3D(testX, testY, testZ); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + CreateTestGeometry(testPoint, surfaceLine); + + // Call + bool valid = surfaceLine.ValidateInRange(invalidValue); + + // Assert + Assert.IsFalse(valid); + } + + [Test] + [TestCase(-0e-3)] + [TestCase(1.37)] + [TestCase(1.0)] + public void ValidateInRange_PointInRange_ReturnsTrue(double validValue) + { + // Setup + const double testX = 1.0; + const double testY = 2.2; + const double testZ = 4.4; + var testPoint = new Point3D(testX, testY, testZ); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + CreateTestGeometry(testPoint, surfaceLine); + + // Call + bool valid = surfaceLine.ValidateInRange(validValue); + + // Assert + Assert.IsTrue(valid); + } + + [Test] + public void GetLocalPointFromGeometry_ValidSurfaceLine_ReturnsLocalPoint() + { + // Setup + const double testX = 1.0; + const double testY = 2.2; + const double testZ = 4.4; + var testPoint = new Point3D(testX, testY, testZ); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + CreateTestGeometry(testPoint, surfaceLine); + + // Call + Point2D localPoint = surfaceLine.GetLocalPointFromGeometry(testPoint); + + // Assert + Assert.AreEqual(new Point2D(0.04, 4.4), localPoint); + } + + [Test] + public void GetLocalPointFromGeometry_NoPointsOnSurfaceLine_ReturnsPointWithNanValues() + { + // Setup + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + + // Call + Point2D localPoint = surfaceLine.GetLocalPointFromGeometry(new Point3D(1.0, 2.2, 4.4)); + + // Assert + Assert.AreEqual(new Point2D(double.NaN, double.NaN), localPoint); + } + + [Test] + public void GetLocalPointFromGeometry_OnePointOnSurfaceLine_ReturnsPointWithNanValues() + { + // Setup + const double testX = 1.0; + const double testY = 2.2; + const double testZ = 4.4; + var testPoint = new Point3D(testX, testY, testZ); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + surfaceLine.SetGeometry(new[] + { + testPoint + }); + + // Call + Point2D localPoint = surfaceLine.GetLocalPointFromGeometry(testPoint); + + // Assert + Assert.AreEqual(new Point2D(double.NaN, double.NaN), localPoint); + } + + [Test] + public void CopyProperties_WithSurfaceLineNull_ThrowsArgumentNullException() + { + // Setup + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + + // Call + TestDelegate call = () => surfaceLine.CopyProperties(null); + + // Assert + string paramName = Assert.Throws(call).ParamName; + Assert.AreEqual("fromSurfaceLine", paramName); + } + + [Test] + public void CopyProperties_LineWithUpdatedGeometricPoints_PropertiesUpdated() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLine = CreateSurfaceLineWithCharacteristicPoints(); + + MacroStabilityInwardsSurfaceLine surfaceLineToUpdateFrom = CreateSurfaceLineWithCharacteristicPoints(); + var expectedGeometry = new List + { + new Point3D(0, 1, 2), + new Point3D(3, 4, 5), + new Point3D(6, 7, 8) + }; + expectedGeometry.AddRange(surfaceLine.Points); + surfaceLineToUpdateFrom.SetGeometry(expectedGeometry); + + // Call + surfaceLine.CopyProperties(surfaceLineToUpdateFrom); + + // Assert + AssertPropertiesUpdated(surfaceLineToUpdateFrom, surfaceLine); + } + + [Test] + public void CopyProperties_LineUpdatedWithRemovedCharacteristicPoints_PropertiesUpdated() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLine = CreateSurfaceLineWithCharacteristicPoints(); + var surfaceLineToUpdateFrom = new MacroStabilityInwardsSurfaceLine + { + Name = surfaceLine.Name, + ReferenceLineIntersectionWorldPoint = surfaceLine.ReferenceLineIntersectionWorldPoint + }; + surfaceLineToUpdateFrom.SetGeometry(surfaceLine.Points); + + // Call + surfaceLine.CopyProperties(surfaceLineToUpdateFrom); + + // Assert + AssertPropertiesUpdated(surfaceLineToUpdateFrom, surfaceLine); + } + + [Test] + public void CopyProperties_LineWithUpdatedReferenceLineWorldPoint_PropertiesUpdated() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLine = CreateSurfaceLineWithCharacteristicPoints(); + + var expectedIntersectionPoint = new Point2D(123, 456); + MacroStabilityInwardsSurfaceLine surfaceLineToUpdateFrom = CreateSurfaceLineWithCharacteristicPoints(); + surfaceLineToUpdateFrom.ReferenceLineIntersectionWorldPoint = expectedIntersectionPoint; + + // Call + surfaceLine.CopyProperties(surfaceLineToUpdateFrom); + + // Assert + AssertPropertiesUpdated(surfaceLineToUpdateFrom, surfaceLine); + } + + [Test] + public void CopyProperties_LineWithUpdatedGeometryAndReferenceLineIntersectionAndCharacteristicPoints_PropertiesUpdated() + { + // Setup + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + MacroStabilityInwardsSurfaceLine surfaceLineToUpdateFrom = CreateSurfaceLineWithCharacteristicPoints(); + + // Call + surfaceLine.CopyProperties(surfaceLineToUpdateFrom); + + // Assert + AssertPropertiesUpdated(surfaceLineToUpdateFrom, surfaceLine); + } + + [Test] + public void Equals_DerivedClassWithEqualProperties_ReturnsTrue() + { + // Setup + MacroStabilityInwardsSurfaceLine profile = CreateSurfaceLineWithCharacteristicPoints(); + var derivedLayer = new TestSurfaceLine(profile); + + // Call + bool areEqual = profile.Equals(derivedLayer); + + // Assert + Assert.IsTrue(areEqual); + } + + [Test] + public void Equals_ToItself_ReturnsTrue() + { + // Setup + var surfaceLineOne = new MacroStabilityInwardsSurfaceLine(); + + // Call + bool isLineOneEqualToLineOne = surfaceLineOne.Equals(surfaceLineOne); + + // Assert + Assert.IsTrue(isLineOneEqualToLineOne); + } + + [Test] + public void Equals_SameReference_ReturnsTrue() + { + // Setup + var surfaceLineOne = new MacroStabilityInwardsSurfaceLine(); + MacroStabilityInwardsSurfaceLine surfaceLineTwo = surfaceLineOne; + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsTrue(isLineOneEqualToLineTwo); + Assert.IsTrue(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_ToNull_ReturnsFalse() + { + // Setup + var surfaceLineOne = new MacroStabilityInwardsSurfaceLine + { + Name = "Name A" + }; + + // Call + bool isLineOneEqualToNull = surfaceLineOne.Equals(null); + + // Assert + Assert.IsFalse(isLineOneEqualToNull); + } + + [Test] + public void Equals_ToDifferentType_ReturnsFalse() + { + // Setup + var surfaceLineOne = new MacroStabilityInwardsSurfaceLine + { + Name = "Name A" + }; + + var differentType = new object(); + + // Call + bool isSurfaceLineEqualToDifferentType = surfaceLineOne.Equals(differentType); + bool isDifferentTypeEqualToSurfaceLine = differentType.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isSurfaceLineEqualToDifferentType); + Assert.IsFalse(isDifferentTypeEqualToSurfaceLine); + } + + [Test] + public void Equals_DifferentNames_ReturnsFalse() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLineOne = CreateSurfaceLineWithCharacteristicPoints(); + surfaceLineOne.Name = "Name A"; + + MacroStabilityInwardsSurfaceLine surfaceLineTwo = CreateSurfaceLineWithCharacteristicPoints(); + surfaceLineTwo.Name = "Name B"; + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_DifferentGeometries_ReturnsFalse() + { + // Setup + var surfaceLineOne = new MacroStabilityInwardsSurfaceLine + { + Name = "Name A" + }; + surfaceLineOne.SetGeometry(new[] + { + new Point3D(1, 2, 3) + }); + + var surfaceLineTwo = new MacroStabilityInwardsSurfaceLine + { + Name = "Name A" + }; + surfaceLineTwo.SetGeometry(new[] + { + new Point3D(3, 4, 5) + }); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_DifferentReferenceLineIntersectionWorldPoint_ReturnsFalse() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLineOne = CreateSurfaceLineWithCharacteristicPoints(); + surfaceLineOne.ReferenceLineIntersectionWorldPoint = new Point2D(0, 0); + + MacroStabilityInwardsSurfaceLine surfaceLineTwo = CreateSurfaceLineWithCharacteristicPoints(); + surfaceLineTwo.ReferenceLineIntersectionWorldPoint = new Point2D(1, 1); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_DifferentSurfaceLevelInside_ReturnsFalse() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLineOne = CreateSurfaceLineWithCharacteristicPoints(); + MacroStabilityInwardsSurfaceLine surfaceLineTwo = CreateSurfaceLineWithCharacteristicPoints(); + Point3D[] points = surfaceLineTwo.Points.ToArray(); + surfaceLineTwo.SetSurfaceLevelInsideAt(points[5]); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_DifferentTrafficLoadInside_ReturnsFalse() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLineOne = CreateSurfaceLineWithCharacteristicPoints(); + MacroStabilityInwardsSurfaceLine surfaceLineTwo = CreateSurfaceLineWithCharacteristicPoints(); + Point3D[] points = surfaceLineTwo.Points.ToArray(); + surfaceLineTwo.SetTrafficLoadInsideAt(points[5]); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_DifferentTrafficLoadOutside_ReturnsFalse() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLineOne = CreateSurfaceLineWithCharacteristicPoints(); + MacroStabilityInwardsSurfaceLine surfaceLineTwo = CreateSurfaceLineWithCharacteristicPoints(); + Point3D[] points = surfaceLineTwo.Points.ToArray(); + surfaceLineTwo.SetTrafficLoadOutsideAt(points[5]); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_DifferentDikeTopAtPolder_ReturnsFalse() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLineOne = CreateSurfaceLineWithCharacteristicPoints(); + MacroStabilityInwardsSurfaceLine surfaceLineTwo = CreateSurfaceLineWithCharacteristicPoints(); + Point3D[] points = surfaceLineTwo.Points.ToArray(); + surfaceLineTwo.SetDikeTopAtPolderAt(points[5]); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_DifferentShoulderBaseInside_ReturnsFalse() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLineOne = CreateSurfaceLineWithCharacteristicPoints(); + MacroStabilityInwardsSurfaceLine surfaceLineTwo = CreateSurfaceLineWithCharacteristicPoints(); + Point3D[] points = surfaceLineTwo.Points.ToArray(); + surfaceLineTwo.SetShoulderBaseInsideAt(points[5]); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_DifferentShoulderTopInside_ReturnsFalse() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLineOne = CreateSurfaceLineWithCharacteristicPoints(); + MacroStabilityInwardsSurfaceLine surfaceLineTwo = CreateSurfaceLineWithCharacteristicPoints(); + Point3D[] points = surfaceLineTwo.Points.ToArray(); + surfaceLineTwo.SetShoulderTopInsideAt(points[7]); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_DifferentSurfaceLevelOutside_ReturnsFalse() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLineOne = CreateSurfaceLineWithCharacteristicPoints(); + MacroStabilityInwardsSurfaceLine surfaceLineTwo = CreateSurfaceLineWithCharacteristicPoints(); + Point3D[] points = surfaceLineTwo.Points.ToArray(); + surfaceLineTwo.SetSurfaceLevelOutsideAt(points[5]); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_DifferentBottomDitchDikeSide_ReturnsFalse() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLineOne = CreateSurfaceLineWithCharacteristicPoints(); + MacroStabilityInwardsSurfaceLine surfaceLineTwo = CreateSurfaceLineWithCharacteristicPoints(); + Point3D[] points = surfaceLineTwo.Points.ToArray(); + surfaceLineTwo.SetBottomDitchDikeSideAt(points[5]); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_DifferentBottomDitchPolderSide_ReturnsFalse() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLineOne = CreateSurfaceLineWithCharacteristicPoints(); + MacroStabilityInwardsSurfaceLine surfaceLineTwo = CreateSurfaceLineWithCharacteristicPoints(); + Point3D[] points = surfaceLineTwo.Points.ToArray(); + surfaceLineTwo.SetBottomDitchPolderSideAt(points[5]); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_DifferentDikeToeAtPolder_ReturnsFalse() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLineOne = CreateSurfaceLineWithCharacteristicPoints(); + MacroStabilityInwardsSurfaceLine surfaceLineTwo = CreateSurfaceLineWithCharacteristicPoints(); + Point3D[] points = surfaceLineTwo.Points.ToArray(); + surfaceLineTwo.SetDikeToeAtPolderAt(points[5]); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_DifferentDikeToeAtRiver_ReturnsFalse() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLineOne = CreateSurfaceLineWithCharacteristicPoints(); + MacroStabilityInwardsSurfaceLine surfaceLineTwo = CreateSurfaceLineWithCharacteristicPoints(); + Point3D[] points = surfaceLineTwo.Points.ToArray(); + surfaceLineTwo.SetDikeToeAtRiverAt(points[5]); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_DifferentDitchDikeSide_ReturnsFalse() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLineOne = CreateSurfaceLineWithCharacteristicPoints(); + MacroStabilityInwardsSurfaceLine surfaceLineTwo = CreateSurfaceLineWithCharacteristicPoints(); + Point3D[] points = surfaceLineTwo.Points.ToArray(); + surfaceLineTwo.SetDitchDikeSideAt(points[1]); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_DifferentDitchPolderSide_ReturnsFalse() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLineOne = CreateSurfaceLineWithCharacteristicPoints(); + MacroStabilityInwardsSurfaceLine surfaceLineTwo = CreateSurfaceLineWithCharacteristicPoints(); + Point3D[] points = surfaceLineTwo.Points.ToArray(); + surfaceLineTwo.SetDitchPolderSideAt(points[1]); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsFalse(isLineOneEqualToLineTwo); + Assert.IsFalse(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_NamesGeometriesAndReferenceLineIntersectionWorldPointAndCharacteristicPointsEqual_ReturnsTrue() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLineOne = CreateSurfaceLineWithCharacteristicPoints(); + MacroStabilityInwardsSurfaceLine surfaceLineTwo = CreateSurfaceLineWithCharacteristicPoints(); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineOne = surfaceLineTwo.Equals(surfaceLineOne); + + // Assert + Assert.IsTrue(isLineOneEqualToLineTwo); + Assert.IsTrue(isLineTwoEqualToLineOne); + } + + [Test] + public void Equals_TransitivePropertyWithSameNamesAndGeometry_ReturnsTrue() + { + // Setup + MacroStabilityInwardsSurfaceLine surfaceLineOne = CreateSurfaceLineWithCharacteristicPoints(); + MacroStabilityInwardsSurfaceLine surfaceLineTwo = CreateSurfaceLineWithCharacteristicPoints(); + MacroStabilityInwardsSurfaceLine surfaceLineThree = CreateSurfaceLineWithCharacteristicPoints(); + + // Call + bool isLineOneEqualToLineTwo = surfaceLineOne.Equals(surfaceLineTwo); + bool isLineTwoEqualToLineThree = surfaceLineTwo.Equals(surfaceLineThree); + bool isLineOneEqualToLineThree = surfaceLineOne.Equals(surfaceLineThree); + + // Assert + Assert.IsTrue(isLineOneEqualToLineTwo); + Assert.IsTrue(isLineTwoEqualToLineThree); + Assert.IsTrue(isLineOneEqualToLineThree); + } + + [Test] + public void GetHashCode_EqualSurfaceLines_ReturnSameHashCode() + { + // Setup + var surfaceLineOne = new MacroStabilityInwardsSurfaceLine(); + var surfaceLineTwo = new MacroStabilityInwardsSurfaceLine(); + + // Call + int hashCodeOne = surfaceLineOne.GetHashCode(); + int hashCodeTwo = surfaceLineTwo.GetHashCode(); + + // Assert + Assert.AreEqual(hashCodeOne, hashCodeTwo); + } + + public abstract class SetCharacteristicPointTest + { + [Test] + public void PointInGeometry_PointSetFromGeometry() + { + // Setup + const double testX = 1.0; + const double testY = 2.2; + const double testZ = 4.4; + var testPoint = new Point3D(testX, testY, testZ); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + CreateTestGeometry(testPoint, surfaceLine); + + // Call + SetCharacteristicPoint(surfaceLine, testPoint); + + // Assert + Assert.AreEqual(testPoint, GetCharacteristicPoint(surfaceLine)); + Assert.AreNotSame(testPoint, GetCharacteristicPoint(surfaceLine)); + } + + [Test] + public void GeometryEmpty_ThrowsInvalidOperationException() + { + // Setup + var random = new Random(21); + var testPoint = new Point3D(random.NextDouble(), random.NextDouble(), random.NextDouble()); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + + // Call + TestDelegate test = () => SetCharacteristicPoint(surfaceLine, testPoint); + + // Assert + string expectedMessage = $"De geometrie bevat geen punt op locatie {testPoint} om als '{CharacteristicPointDescription()}' in te stellen."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + } + + [Test] + public void Null_ThrowsArgumentNullException() + { + // Setup + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); + + // Call + TestDelegate test = () => SetCharacteristicPoint(surfaceLine, null); + + // Assert + const string expectedMessage = "Cannot find a point in geometry using a null point."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + } + + protected abstract void SetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point); + protected abstract Point3D GetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine); + protected abstract string CharacteristicPointDescription(); + } + + [TestFixture] + public class SetDitchPolderSideAtTest : SetCharacteristicPointTest + { + protected override void SetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + { + surfaceLine.SetDitchPolderSideAt(point); + } + + protected override Point3D GetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine) + { + return surfaceLine.DitchPolderSide; + } + + protected override string CharacteristicPointDescription() + { + return "Insteek sloot polderzijde"; + } + } + + [TestFixture] + public class SetBottomDitchPolderSideAtTest : SetCharacteristicPointTest + { + protected override void SetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + { + surfaceLine.SetBottomDitchPolderSideAt(point); + } + + protected override Point3D GetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine) + { + return surfaceLine.BottomDitchPolderSide; + } + + protected override string CharacteristicPointDescription() + { + return "Slootbodem polderzijde"; + } + } + + [TestFixture] + public class SetBottomDitchDikeSideAtTest : SetCharacteristicPointTest + { + protected override void SetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + { + surfaceLine.SetBottomDitchDikeSideAt(point); + } + + protected override Point3D GetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine) + { + return surfaceLine.BottomDitchDikeSide; + } + + protected override string CharacteristicPointDescription() + { + return "Slootbodem dijkzijde"; + } + } + + [TestFixture] + public class SetDitchDikeSideAtTest : SetCharacteristicPointTest + { + protected override void SetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + { + surfaceLine.SetDitchDikeSideAt(point); + } + + protected override Point3D GetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine) + { + return surfaceLine.DitchDikeSide; + } + + protected override string CharacteristicPointDescription() + { + return "Insteek sloot dijkzijde"; + } + } + + [TestFixture] + public class SetDikeTopAtPolderAtTest : SetCharacteristicPointTest + { + protected override void SetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + { + surfaceLine.SetDikeTopAtPolderAt(point); + } + + protected override Point3D GetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine) + { + return surfaceLine.DikeTopAtPolder; + } + + protected override string CharacteristicPointDescription() + { + return "Kruin binnentalud"; + } + } + + [TestFixture] + public class SetShoulderBaseInsideAtTest : SetCharacteristicPointTest + { + protected override void SetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + { + surfaceLine.SetShoulderBaseInsideAt(point); + } + + protected override Point3D GetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine) + { + return surfaceLine.ShoulderBaseInside; + } + + protected override string CharacteristicPointDescription() + { + return "Insteek binnenberm"; + } + } + + [TestFixture] + public class SetShoulderTopInsideAtTest : SetCharacteristicPointTest + { + protected override void SetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + { + surfaceLine.SetShoulderTopInsideAt(point); + } + + protected override Point3D GetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine) + { + return surfaceLine.ShoulderTopInside; + } + + protected override string CharacteristicPointDescription() + { + return "Kruin binnenberm"; + } + } + + [TestFixture] + public class SetSurfaceLevelInsideAtTest : SetCharacteristicPointTest + { + protected override void SetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + { + surfaceLine.SetSurfaceLevelInsideAt(point); + } + + protected override Point3D GetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine) + { + return surfaceLine.SurfaceLevelInside; + } + + protected override string CharacteristicPointDescription() + { + return "Maaiveld binnenwaarts"; + } + } + + [TestFixture] + public class SetSurfaceLevelOutsideAtTest : SetCharacteristicPointTest + { + protected override void SetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + { + surfaceLine.SetSurfaceLevelOutsideAt(point); + } + + protected override Point3D GetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine) + { + return surfaceLine.SurfaceLevelOutside; + } + + protected override string CharacteristicPointDescription() + { + return "Maaiveld buitenwaarts"; + } + } + + [TestFixture] + public class SetTrafficLoadInsideAtTest : SetCharacteristicPointTest + { + protected override void SetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + { + surfaceLine.SetTrafficLoadInsideAt(point); + } + + protected override Point3D GetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine) + { + return surfaceLine.TrafficLoadInside; + } + + protected override string CharacteristicPointDescription() + { + return "Verkeersbelasting kant binnenwaarts"; + } + } + + [TestFixture] + public class SetTrafficLoadOutsideAtTest : SetCharacteristicPointTest + { + protected override void SetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + { + surfaceLine.SetTrafficLoadOutsideAt(point); + } + + protected override Point3D GetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine) + { + return surfaceLine.TrafficLoadOutside; + } + + protected override string CharacteristicPointDescription() + { + return "Verkeersbelasting kant buitenwaarts"; + } + } + + [TestFixture] + public class SetDikeToeAtRiverAtTest : SetCharacteristicPointTest + { + protected override void SetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + { + surfaceLine.SetDikeToeAtRiverAt(point); + } + + protected override Point3D GetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine) + { + return surfaceLine.DikeToeAtRiver; + } + + protected override string CharacteristicPointDescription() + { + return "Teen dijk buitenwaarts"; + } + } + + [TestFixture] + public class SetDikeToeAtPolderAtTest : SetCharacteristicPointTest + { + protected override void SetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine, Point3D point) + { + surfaceLine.SetDikeToeAtPolderAt(point); + } + + protected override Point3D GetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine) + { + return surfaceLine.DikeToeAtPolder; + } + + protected override string CharacteristicPointDescription() + { + return "Teen dijk binnenwaarts"; + } + } + + private class TestSurfaceLine : MacroStabilityInwardsSurfaceLine + { + public TestSurfaceLine(MacroStabilityInwardsSurfaceLine profile) + { + CopyProperties(profile); + } + } + + private static void AssertPropertiesUpdated(MacroStabilityInwardsSurfaceLine expectedSurfaceLine, + MacroStabilityInwardsSurfaceLine actualSurfaceLine) + { + Assert.AreEqual(expectedSurfaceLine.Name, actualSurfaceLine.Name); + TestHelper.AssertAreEqualButNotSame(expectedSurfaceLine.ReferenceLineIntersectionWorldPoint, + actualSurfaceLine.ReferenceLineIntersectionWorldPoint); + CollectionAssert.AreEqual(expectedSurfaceLine.Points, actualSurfaceLine.Points); + TestHelper.AssertCollectionAreNotSame(expectedSurfaceLine.Points, actualSurfaceLine.Points); + + Point3D[] actualSurfaceLinePoints = actualSurfaceLine.Points; + AssertAreEqualAndFromSurfaceLine(actualSurfaceLinePoints, expectedSurfaceLine.SurfaceLevelOutside, actualSurfaceLine.SurfaceLevelOutside); + AssertAreEqualAndFromSurfaceLine(actualSurfaceLinePoints, expectedSurfaceLine.TrafficLoadOutside, actualSurfaceLine.TrafficLoadOutside); + AssertAreEqualAndFromSurfaceLine(actualSurfaceLinePoints, expectedSurfaceLine.TrafficLoadInside, actualSurfaceLine.TrafficLoadInside); + AssertAreEqualAndFromSurfaceLine(actualSurfaceLinePoints, expectedSurfaceLine.DikeTopAtPolder, actualSurfaceLine.DikeTopAtPolder); + AssertAreEqualAndFromSurfaceLine(actualSurfaceLinePoints, expectedSurfaceLine.ShoulderBaseInside, actualSurfaceLine.ShoulderBaseInside); + AssertAreEqualAndFromSurfaceLine(actualSurfaceLinePoints, expectedSurfaceLine.ShoulderTopInside, actualSurfaceLine.ShoulderTopInside); + AssertAreEqualAndFromSurfaceLine(actualSurfaceLinePoints, expectedSurfaceLine.BottomDitchDikeSide, actualSurfaceLine.BottomDitchDikeSide); + AssertAreEqualAndFromSurfaceLine(actualSurfaceLinePoints, expectedSurfaceLine.BottomDitchPolderSide, actualSurfaceLine.BottomDitchPolderSide); + AssertAreEqualAndFromSurfaceLine(actualSurfaceLinePoints, expectedSurfaceLine.DikeToeAtPolder, actualSurfaceLine.DikeToeAtPolder); + AssertAreEqualAndFromSurfaceLine(actualSurfaceLinePoints, expectedSurfaceLine.DikeToeAtRiver, actualSurfaceLine.DikeToeAtRiver); + AssertAreEqualAndFromSurfaceLine(actualSurfaceLinePoints, expectedSurfaceLine.DitchPolderSide, actualSurfaceLine.DitchPolderSide); + AssertAreEqualAndFromSurfaceLine(actualSurfaceLinePoints, expectedSurfaceLine.DitchDikeSide, actualSurfaceLine.DitchDikeSide); + AssertAreEqualAndFromSurfaceLine(actualSurfaceLinePoints, expectedSurfaceLine.SurfaceLevelInside, actualSurfaceLine.SurfaceLevelInside); + } + + private static void AssertAreEqualAndFromSurfaceLine(Point3D[] actualSurfaceLinePoints, Point3D expectedPoint, Point3D actualPoint) + { + Assert.AreEqual(expectedPoint, actualPoint); + if (actualPoint != null) + { + Assert.IsTrue(actualSurfaceLinePoints.Contains(actualPoint, new ReferenceEqualityComparer())); + } + } + + private static MacroStabilityInwardsSurfaceLine CreateSurfaceLineWithCharacteristicPoints() + { + var surfaceLine = new MacroStabilityInwardsSurfaceLine + { + Name = "Name A", + ReferenceLineIntersectionWorldPoint = new Point2D(0, 0) + }; + var geometry = new[] + { + new Point3D(0, 0, 0), + new Point3D(1, 0, 2), + new Point3D(2, 0, 3), + new Point3D(3, 0, 0), + new Point3D(4, 0, 2), + new Point3D(5, 0, 3), + new Point3D(6, 0, 4), + new Point3D(7, 0, 5), + new Point3D(8, 0, 5), + new Point3D(9, 0, 4), + new Point3D(10, 0, 3), + new Point3D(11, 0, 2), + new Point3D(12, 0, 1) + }; + surfaceLine.SetGeometry(geometry); + + surfaceLine.SetSurfaceLevelOutsideAt(geometry[0]); + surfaceLine.SetTrafficLoadOutsideAt(geometry[1]); + surfaceLine.SetTrafficLoadInsideAt(geometry[2]); + surfaceLine.SetDikeTopAtPolderAt(geometry[3]); + surfaceLine.SetShoulderBaseInsideAt(geometry[4]); + surfaceLine.SetShoulderTopInsideAt(geometry[5]); + surfaceLine.SetBottomDitchDikeSideAt(geometry[6]); + surfaceLine.SetBottomDitchPolderSideAt(geometry[7]); + surfaceLine.SetDikeToeAtPolderAt(geometry[8]); + surfaceLine.SetDikeToeAtRiverAt(geometry[9]); + surfaceLine.SetDitchDikeSideAt(geometry[10]); + surfaceLine.SetDitchPolderSideAt(geometry[11]); + surfaceLine.SetSurfaceLevelInsideAt(geometry[12]); + + return surfaceLine; + } + + private static void CreateTestGeometry(Point3D testPoint, MacroStabilityInwardsSurfaceLine surfaceLine) + { + var random = new Random(21); + var points = new[] + { + new Point3D(random.NextDouble(), random.NextDouble(), random.NextDouble()), + new Point3D(testPoint), + new Point3D(2 + random.NextDouble(), random.NextDouble(), random.NextDouble()) + }; + surfaceLine.SetGeometry(points); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Ringtoets.MacroStabilityInwards.Primitives.Test.csproj =================================================================== diff -u -r669e99259a7cc575b5df2be2c0ea7105d9edcbcf -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Ringtoets.MacroStabilityInwards.Primitives.Test.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.Test.csproj) (revision 669e99259a7cc575b5df2be2c0ea7105d9edcbcf) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Ringtoets.MacroStabilityInwards.Primitives.Test.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.Test.csproj) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -53,14 +53,14 @@ Properties\GlobalAssembly.cs - + - + Fisheye: Tag cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/RingtoetsMacroStabilityInwardsSurfaceLineTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsDataSynchronizationServiceTest.cs =================================================================== diff -u -r553ea9461421deb6f14aaedd004f113868c5214b -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsDataSynchronizationServiceTest.cs (.../MacroStabilityInwardsDataSynchronizationServiceTest.cs) (revision 553ea9461421deb6f14aaedd004f113868c5214b) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsDataSynchronizationServiceTest.cs (.../MacroStabilityInwardsDataSynchronizationServiceTest.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -213,7 +213,7 @@ { // Setup MacroStabilityInwardsFailureMechanism failureMechanism = null; - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + var surfaceLine = new MacroStabilityInwardsSurfaceLine(); // Call TestDelegate call = () => MacroStabilityInwardsDataSynchronizationService.RemoveSurfaceLine(failureMechanism, surfaceLine); @@ -228,7 +228,7 @@ { // Setup var failureMechanism = new MacroStabilityInwardsFailureMechanism(); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = null; + MacroStabilityInwardsSurfaceLine surfaceLine = null; // Call TestDelegate call = () => MacroStabilityInwardsDataSynchronizationService.RemoveSurfaceLine(failureMechanism, surfaceLine); @@ -243,7 +243,7 @@ { // Setup MacroStabilityInwardsFailureMechanism failureMechanism = MacroStabilityInwardsTestDataGenerator.GetMacroStabilityInwardsFailureMechanismWithAllCalculationConfigurations(); - RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine = failureMechanism.SurfaceLines[0]; + MacroStabilityInwardsSurfaceLine surfaceLine = failureMechanism.SurfaceLines[0]; MacroStabilityInwardsCalculation[] calculationsWithSurfaceLine = failureMechanism.Calculations .Cast() .Where(c => ReferenceEquals(c.InputParameters.SurfaceLine, surfaceLine)) Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingSurfaceLinesContext.cs =================================================================== diff -u -raa49537188229065df91b1a931f088c32115702a -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingSurfaceLinesContext.cs (.../PipingSurfaceLinesContext.cs) (revision aa49537188229065df91b1a931f088c32115702a) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingSurfaceLinesContext.cs (.../PipingSurfaceLinesContext.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213) @@ -35,7 +35,7 @@ /// Creates a new instance of . /// /// The collection to update. - /// The failure mechanism + /// The failure mechanism. /// The assessment section. /// Thrown when any input argument is null. public PipingSurfaceLinesContext(PipingSurfaceLineCollection surfaceLines,