Index: Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/ReferenceLineMeta.cs =================================================================== diff -u -r22314fc5cda60354caef8993c7da004d784e46c4 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/ReferenceLineMeta.cs (.../ReferenceLineMeta.cs) (revision 22314fc5cda60354caef8993c7da004d784e46c4) +++ Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/ReferenceLineMeta.cs (.../ReferenceLineMeta.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -52,6 +52,6 @@ /// /// Gets the reference line. /// - public ReferenceLine ReferenceLine { get; private set; } + public ReferenceLine ReferenceLine { get; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/WellKnownBackgroundDataConfiguration.cs =================================================================== diff -u -r48e2db6c910f4ec279d2d63fbb1cc05a1196b7f1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/WellKnownBackgroundDataConfiguration.cs (.../WellKnownBackgroundDataConfiguration.cs) (revision 48e2db6c910f4ec279d2d63fbb1cc05a1196b7f1) +++ Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/WellKnownBackgroundDataConfiguration.cs (.../WellKnownBackgroundDataConfiguration.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -38,6 +38,6 @@ /// /// Gets the type of well known tile source. /// - public RingtoetsWellKnownTileSource WellKnownTileSource { get; private set; } + public RingtoetsWellKnownTileSource WellKnownTileSource { get; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismSectionResult.cs =================================================================== diff -u -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismSectionResult.cs (.../FailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) +++ Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismSectionResult.cs (.../FailureMechanismSectionResult.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -21,7 +21,6 @@ using System; using Core.Common.Base; -using Core.Common.Base.Data; namespace Ringtoets.Common.Data.FailureMechanism { @@ -53,6 +52,6 @@ /// /// Gets the encapsulated . /// - public FailureMechanismSection Section { get; private set; } + public FailureMechanismSection Section { get; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicBoundaryDatabase.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicBoundaryDatabase.cs (.../HydraulicBoundaryDatabase.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicBoundaryDatabase.cs (.../HydraulicBoundaryDatabase.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -51,6 +51,6 @@ /// /// Gets the hydraulic boundary locations. /// - public List Locations { get; private set; } + public List Locations { get; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/IllustrationPoints/IllustrationPointNode.cs =================================================================== diff -u -rf0538a6a9af2faa964cb8d16afa6f5336a014cc1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Data/IllustrationPoints/IllustrationPointNode.cs (.../IllustrationPointNode.cs) (revision f0538a6a9af2faa964cb8d16afa6f5336a014cc1) +++ Ringtoets/Common/src/Ringtoets.Common.Data/IllustrationPoints/IllustrationPointNode.cs (.../IllustrationPointNode.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -89,7 +89,7 @@ var faultTreeData = Data as FaultTreeIllustrationPoint; if (faultTreeData != null) { - ValidateChildNames(faultTreeData, children); + ValidateChildNames(children); ValidateChildStochasts(faultTreeData, children); } @@ -109,11 +109,10 @@ /// /// Validates a by checking for duplicate names in child nodes. /// - /// The to be validated. /// The collection of to be validated. /// Thrown when contains child nodes with /// duplicate names. - private static void ValidateChildNames(FaultTreeIllustrationPoint data, IEnumerable children) + private static void ValidateChildNames(IEnumerable children) { if (children.HasDuplicates(c => c.Data.Name)) { Index: Ringtoets/Common/src/Ringtoets.Common.Data/IllustrationPoints/TopLevelSubMechanismIllustrationPoint.cs =================================================================== diff -u -r2a88a3e4469b6b59db4ca9ff874cf69804c9393e -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Data/IllustrationPoints/TopLevelSubMechanismIllustrationPoint.cs (.../TopLevelSubMechanismIllustrationPoint.cs) (revision 2a88a3e4469b6b59db4ca9ff874cf69804c9393e) +++ Ringtoets/Common/src/Ringtoets.Common.Data/IllustrationPoints/TopLevelSubMechanismIllustrationPoint.cs (.../TopLevelSubMechanismIllustrationPoint.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -38,7 +38,7 @@ /// Thrown when any input parameter is null. public TopLevelSubMechanismIllustrationPoint(WindDirection windDirection, string closingSituation, - SubMechanismIllustrationPoint subMechanismIllustrationPoint) + SubMechanismIllustrationPoint subMechanismIllustrationPoint) : base(windDirection, closingSituation) { if (subMechanismIllustrationPoint == null) Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Factories/RingtoetsMapDataFeaturesFactory.cs =================================================================== diff -u -r4b8ab1201eba50035392ce074fa1cc5da25ff4a7 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Factories/RingtoetsMapDataFeaturesFactory.cs (.../RingtoetsMapDataFeaturesFactory.cs) (revision 4b8ab1201eba50035392ce074fa1cc5da25ff4a7) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Factories/RingtoetsMapDataFeaturesFactory.cs (.../RingtoetsMapDataFeaturesFactory.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -284,18 +284,20 @@ /// /// Create calculation features based on the provided . /// + /// The type of the . + /// The type of the . /// The collection of to create the /// calculation features for. /// An array of features or an empty array when is null /// or empty. - public static MapFeature[] CreateStructureCalculationsFeatures(IEnumerable> calculations) - where T : StructuresInputBase, new() - where U : StructureBase + public static MapFeature[] CreateStructureCalculationsFeatures(IEnumerable> calculations) + where T : StructuresInputBase, new() + where TU : StructureBase { if (calculations != null && calculations.Any()) { - MapCalculationData[] calculationData = calculations.Where(CalculationHasStructureAndHydraulicBoundaryLocation) - .Select(CreatemapCalculationData).ToArray(); + MapCalculationData[] calculationData = calculations.Where(CalculationHasStructureAndHydraulicBoundaryLocation) + .Select(CreatemapCalculationData).ToArray(); return CreateCalculationFeatures(calculationData); } @@ -363,19 +365,19 @@ }); } - private static MapCalculationData CreatemapCalculationData(StructuresCalculation calculation) - where T : StructuresInputBase, new() - where U : StructureBase + private static MapCalculationData CreatemapCalculationData(StructuresCalculation calculation) + where T : StructuresInputBase, new() + where TU : StructureBase { return new MapCalculationData( calculation.Name, calculation.InputParameters.Structure.Location, calculation.InputParameters.HydraulicBoundaryLocation); } - private static bool CalculationHasStructureAndHydraulicBoundaryLocation(StructuresCalculation calculation) - where T : StructuresInputBase, new() - where U : StructureBase + private static bool CalculationHasStructureAndHydraulicBoundaryLocation(StructuresCalculation calculation) + where T : StructuresInputBase, new() + where TU : StructureBase { return calculation.InputParameters.Structure != null && calculation.InputParameters.HydraulicBoundaryLocation != null; Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Helpers/NamingHelper.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Helpers/NamingHelper.cs (.../NamingHelper.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Helpers/NamingHelper.cs (.../NamingHelper.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -46,7 +46,7 @@ string[] existingNames = existingObjects.Select(nameGetter).ToArray(); while (existingNames.Any(name => name.Equals(result))) { - result = string.Format("{0} ({1})", nameBase, i++); + result = $"{nameBase} ({i++})"; } return result; } Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/CategoryTreeFolder.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/CategoryTreeFolder.cs (.../CategoryTreeFolder.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/CategoryTreeFolder.cs (.../CategoryTreeFolder.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -56,7 +56,7 @@ /// /// Gets the category of the folder. /// - public TreeFolderCategory Category { get; private set; } + public TreeFolderCategory Category { get; } public override bool Equals(object obj) { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismContext.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismContext.cs (.../FailureMechanismContext.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismContext.cs (.../FailureMechanismContext.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -51,6 +51,6 @@ /// /// Gets the parent of . /// - public IAssessmentSection Parent { get; private set; } + public IAssessmentSection Parent { get; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismContributionContext.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismContributionContext.cs (.../FailureMechanismContributionContext.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismContributionContext.cs (.../FailureMechanismContributionContext.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -51,6 +51,6 @@ /// /// Gets the assessment section to which belongs to. /// - public IAssessmentSection Parent { get; private set; } + public IAssessmentSection Parent { get; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismItemContextBase.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismItemContextBase.cs (.../FailureMechanismItemContextBase.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismItemContextBase.cs (.../FailureMechanismItemContextBase.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -68,7 +68,7 @@ /// /// Gets the failure mechanism which the context belongs to. /// - public TFailureMechanism FailureMechanism { get; private set; } + public TFailureMechanism FailureMechanism { get; } /// /// Gets the assessment section which the context belongs to. Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismSectionResultContext.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismSectionResultContext.cs (.../FailureMechanismSectionResultContext.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismSectionResultContext.cs (.../FailureMechanismSectionResultContext.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -51,6 +51,6 @@ /// /// Gets the . /// - public IFailureMechanism FailureMechanism { get; private set; } + public IFailureMechanism FailureMechanism { get; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismSectionsContext.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismSectionsContext.cs (.../FailureMechanismSectionsContext.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismSectionsContext.cs (.../FailureMechanismSectionsContext.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -51,6 +51,6 @@ /// /// Gets the assessment section which the context belongs to. /// - public IAssessmentSection ParentAssessmentSection { get; private set; } + public IAssessmentSection ParentAssessmentSection { get; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/ForeshoreProfilesContext.cs =================================================================== diff -u -red4b032b9903f394deb9691c2c39a9f2122ab0f5 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/ForeshoreProfilesContext.cs (.../ForeshoreProfilesContext.cs) (revision ed4b032b9903f394deb9691c2c39a9f2122ab0f5) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/ForeshoreProfilesContext.cs (.../ForeshoreProfilesContext.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -59,11 +59,11 @@ /// /// Gets the parent assessment section. /// - public IAssessmentSection ParentAssessmentSection { get; private set; } + public IAssessmentSection ParentAssessmentSection { get; } /// /// Gets the parent failure mechanism. /// - public IFailureMechanism ParentFailureMechanism { get; private set; } + public IFailureMechanism ParentFailureMechanism { get; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/InputContextBase.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/InputContextBase.cs (.../InputContextBase.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/InputContextBase.cs (.../InputContextBase.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -59,6 +59,6 @@ /// /// Gets the calculation item which the context belongs to. /// - public TCalculation Calculation { get; private set; } + public TCalculation Calculation { get; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/MapCalculationData.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/MapCalculationData.cs (.../MapCalculationData.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/MapCalculationData.cs (.../MapCalculationData.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -61,16 +61,16 @@ /// /// Gets the name of the calculation. /// - public string Name { get; private set; } + public string Name { get; } /// /// Gets the location of the calculation. /// - public Point2D CalculationLocation { get; private set; } + public Point2D CalculationLocation { get; } /// /// Gets the hydraulic boundary location assigned to the calculation. /// - public HydraulicBoundaryLocation HydraulicBoundaryLocation { get; private set; } + public HydraulicBoundaryLocation HydraulicBoundaryLocation { get; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/SelectableHydraulicBoundaryLocation.cs =================================================================== diff -u -r48e2db6c910f4ec279d2d63fbb1cc05a1196b7f1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/SelectableHydraulicBoundaryLocation.cs (.../SelectableHydraulicBoundaryLocation.cs) (revision 48e2db6c910f4ec279d2d63fbb1cc05a1196b7f1) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/SelectableHydraulicBoundaryLocation.cs (.../SelectableHydraulicBoundaryLocation.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -95,8 +95,8 @@ } return Distance < 1000 - ? string.Format("{0} ({1:f0} m)", HydraulicBoundaryLocation.Name, Distance) - : string.Format("{0} ({1:f1} km)", HydraulicBoundaryLocation.Name, Distance / 1000); + ? $"{HydraulicBoundaryLocation.Name} ({Distance:f0} m)" + : $"{HydraulicBoundaryLocation.Name} ({Distance / 1000:f1} km)"; } private bool Equals(SelectableHydraulicBoundaryLocation other) Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ForeshoreProfileCollectionProperties.cs =================================================================== diff -u -rfa2297cc58fe8faa6e573c68d9bb9768ba44ed23 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ForeshoreProfileCollectionProperties.cs (.../ForeshoreProfileCollectionProperties.cs) (revision fa2297cc58fe8faa6e573c68d9bb9768ba44ed23) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ForeshoreProfileCollectionProperties.cs (.../ForeshoreProfileCollectionProperties.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -58,4 +58,4 @@ } } } -} +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsChartControl.cs =================================================================== diff -u -rb71275523a4a1554cfdcd8a1840bdf741946028f -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsChartControl.cs (.../IllustrationPointsChartControl.cs) (revision b71275523a4a1554cfdcd8a1840bdf741946028f) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsChartControl.cs (.../IllustrationPointsChartControl.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -31,10 +31,9 @@ /// public partial class IllustrationPointsChartControl : UserControl { + private readonly StackChartData chartData; private IEnumerable data; - private readonly StackChartData chartData; - /// /// Creates a new instance of . /// Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/SelectableRow.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/SelectableRow.cs (.../SelectableRow.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/SelectableRow.cs (.../SelectableRow.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -56,11 +56,11 @@ /// /// Gets the name of the . /// - public string Name { get; private set; } + public string Name { get; } /// /// Gets the item. /// - public T Item { get; private set; } + public T Item { get; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.IO/AssessmentSectionSettings.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.IO/AssessmentSectionSettings.cs (.../AssessmentSectionSettings.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.IO/AssessmentSectionSettings.cs (.../AssessmentSectionSettings.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -39,17 +39,17 @@ /// /// The 'length effect' parameter. /// - public int N { get; private set; } + public int N { get; } /// /// Gets a value indicating whether this instance is a dune assessment section or not. /// - public bool IsDune { get; private set; } + public bool IsDune { get; } /// /// Gets the assessment section identifier, that can be used to match to . /// - public string AssessmentSectionId { get; private set; } + public string AssessmentSectionId { get; } /// /// Creates the settings for a dike assessment section. Index: Ringtoets/Common/src/Ringtoets.Common.IO/DikeProfiles/ProfileLocation.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.IO/DikeProfiles/ProfileLocation.cs (.../ProfileLocation.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.IO/DikeProfiles/ProfileLocation.cs (.../ProfileLocation.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -70,21 +70,21 @@ /// /// Gets the identifier for this . /// - public string Id { get; private set; } + public string Id { get; } /// /// Gets the name of this . /// - public string Name { get; private set; } + public string Name { get; } /// /// Gets the coordinate offset in the local coordinate system for this . /// - public double Offset { get; private set; } + public double Offset { get; } /// /// Gets the actual location of this . /// - public Point2D Point { get; private set; } + public Point2D Point { get; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/HydraRingSettingsDatabaseReader.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/HydraRingSettingsDatabaseReader.cs (.../HydraRingSettingsDatabaseReader.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/HydraRingSettingsDatabaseReader.cs (.../HydraRingSettingsDatabaseReader.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -86,43 +86,25 @@ public HydraRingSettingsDatabaseReader(string databaseFilePath) : base(databaseFilePath) { - designTableSettingsForLocationAndCalculationTypeQuery = string.Format( - "SELECT {0}, {1} FROM DesignTablesSettings WHERE LocationID = {2} AND CalculationTypeID = {3}", - minColumn, - maxColumn, - locationIdParameterName, - calculationTypeIdParameterName); + designTableSettingsForLocationAndCalculationTypeQuery = + $"SELECT {minColumn}, {maxColumn} " + + "FROM DesignTablesSettings " + + $"WHERE LocationID = {locationIdParameterName} AND CalculationTypeID = {calculationTypeIdParameterName}"; - numericSettingsForLocationMechanismAndSubMechanismQuery = string.Format( - "SELECT {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13} " + - "FROM NumericsSettings WHERE LocationID = {14} AND MechanismID = {15} AND SubMechanismID = {16}", - calculationTechniqueIdColumn, - formStartMethodColumn, - formNumberOfIterationsColumn, - formRelaxationFactorColumn, - formEpsBetaColumn, - formEpsHohColumn, - formEpsZFuncColumn, - dsStartMethodColumn, - dsMinNumberOfIterationsColumn, - dsMaxNumberOfIterationsColumn, - dsVarCoefficientColumn, - niUMinColumn, - niUMaxColumn, - niNumberStepsColumn, - locationIdParameterName, - mechanismIdParameterName, - subMechanismIdParameterName); + numericSettingsForLocationMechanismAndSubMechanismQuery = + $"SELECT {calculationTechniqueIdColumn}, {formStartMethodColumn}, {formNumberOfIterationsColumn}, " + + $"{formRelaxationFactorColumn}, {formEpsBetaColumn}, {formEpsHohColumn}, {formEpsZFuncColumn}, " + + $"{dsStartMethodColumn}, {dsMinNumberOfIterationsColumn}, {dsMaxNumberOfIterationsColumn}, " + + $"{dsVarCoefficientColumn}, {niUMinColumn}, {niUMaxColumn}, {niNumberStepsColumn} " + + "FROM NumericsSettings " + + $"WHERE LocationID = {locationIdParameterName} AND MechanismID = {mechanismIdParameterName} AND SubMechanismID = {subMechanismIdParameterName}"; - timeIntegrationSettingsForLocationAndCalculationTypeQuery = string.Format( - "SELECT {0} FROM TimeIntegrationSettings WHERE LocationID = {1} AND CalculationTypeID = {2}", - timeIntegrationSchemeIdColumn, - locationIdParameterName, - calculationTypeIdParameterName); + timeIntegrationSettingsForLocationAndCalculationTypeQuery = + $"SELECT {timeIntegrationSchemeIdColumn} " + + $"FROM TimeIntegrationSettings " + + $"WHERE LocationID = {locationIdParameterName} AND CalculationTypeID = {calculationTypeIdParameterName}"; - excludedLocationsQuery = string.Format( - "SELECT {0} FROM ExcludedLocations", - locationIdColumn); + excludedLocationsQuery = $"SELECT {locationIdColumn} FROM ExcludedLocations"; ValidateSchema(); } @@ -141,7 +123,7 @@ { if (!Enum.IsDefined(calculationType.GetType(), calculationType)) { - throw new InvalidEnumArgumentException("calculationType", (int) calculationType, calculationType.GetType()); + throw new InvalidEnumArgumentException(nameof(calculationType), (int) calculationType, calculationType.GetType()); } using (IDataReader reader = CreateDesignTablesDataReader(locationId, calculationType)) @@ -219,7 +201,7 @@ { if (!Enum.IsDefined(calculationType.GetType(), calculationType)) { - throw new InvalidEnumArgumentException("calculationType", (int) calculationType, calculationType.GetType()); + throw new InvalidEnumArgumentException(nameof(calculationType), (int) calculationType, calculationType.GetType()); } using (IDataReader reader = CreateTimeIntegrationDataReader(locationId, calculationType)) Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/DistributionHelper.cs =================================================================== diff -u -re0a8485a3cf901190fd8a6f20589798f1741f219 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/DistributionHelper.cs (.../DistributionHelper.cs) (revision e0a8485a3cf901190fd8a6f20589798f1741f219) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/DistributionHelper.cs (.../DistributionHelper.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -51,7 +51,7 @@ } if (distributionType.HasValue && (distributionType.Value != SoilLayerConstants.LogNormalDistributionValue - || Math.Abs(shift) > tolerance)) + || Math.Abs(shift) > tolerance)) { throw new ImportedDataTransformException(string.Format( Resources.Stochastic_parameter_0_has_no_lognormal_distribution, Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilProfile2D.cs =================================================================== diff -u -r0cd61a43db63bff5fb38589d1f7ae2c012249490 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilProfile2D.cs (.../SoilProfile2D.cs) (revision 0cd61a43db63bff5fb38589d1f7ae2c012249490) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilProfile2D.cs (.../SoilProfile2D.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -21,7 +21,6 @@ using System; using System.Collections.Generic; -using System.Linq; namespace Ringtoets.Common.IO.SoilProfile { Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilProfile2DReader.cs =================================================================== diff -u -r0cd61a43db63bff5fb38589d1f7ae2c012249490 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilProfile2DReader.cs (.../SoilProfile2DReader.cs) (revision 0cd61a43db63bff5fb38589d1f7ae2c012249490) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilProfile2DReader.cs (.../SoilProfile2DReader.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -187,9 +187,9 @@ } return new SoilProfile2D(soilProfileId, - criticalProperties.ProfileName, - GetHierarchicallyOrderedSoilLayers(soilLayerGeometryLookup).ToArray(), - GetPreconsolidationStresses(soilProfileId).ToArray()) + criticalProperties.ProfileName, + GetHierarchicallyOrderedSoilLayers(soilLayerGeometryLookup).ToArray(), + GetPreconsolidationStresses(soilProfileId).ToArray()) { IntersectionX = properties.IntersectionX }; Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/StochasticSoilProfile.cs =================================================================== diff -u -r30baf70ea42def18e66d1ec3c71aa0e54a89229a -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/StochasticSoilProfile.cs (.../StochasticSoilProfile.cs) (revision 30baf70ea42def18e66d1ec3c71aa0e54a89229a) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/StochasticSoilProfile.cs (.../StochasticSoilProfile.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -20,10 +20,6 @@ // All rights reserved. using System; -using System.Globalization; -using Core.Common.Base; -using Core.Common.Base.Data; -using Ringtoets.Common.IO.Properties; namespace Ringtoets.Common.IO.SoilProfile { @@ -32,7 +28,6 @@ /// public class StochasticSoilProfile { - /// /// Creates a new instance of . /// Index: Ringtoets/Common/src/Ringtoets.Common.IO/Structures/IStructureUpdateStrategy.cs =================================================================== diff -u -reac26978d0b0353d0c01dfae7108e861092fa39f -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.IO/Structures/IStructureUpdateStrategy.cs (.../IStructureUpdateStrategy.cs) (revision eac26978d0b0353d0c01dfae7108e861092fa39f) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Structures/IStructureUpdateStrategy.cs (.../IStructureUpdateStrategy.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -31,7 +31,7 @@ /// Interface describing the method of updating the data model after new structures have /// been imported. /// - public interface IStructureUpdateStrategy where TStructure : StructureBase + public interface IStructureUpdateStrategy where TStructure : StructureBase { /// /// Updates the structures and its dependent data with data from . Index: Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructureLocation.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructureLocation.cs (.../StructureLocation.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructureLocation.cs (.../StructureLocation.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -58,16 +58,16 @@ /// /// Gets the identifier for this . /// - public string Id { get; private set; } + public string Id { get; } /// /// Gets the name of this . /// - public string Name { get; private set; } + public string Name { get; } /// /// Gets the actual location of this . /// - public Point2D Point { get; private set; } + public Point2D Point { get; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.IO/Structures/ValidationResult.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.IO/Structures/ValidationResult.cs (.../ValidationResult.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Structures/ValidationResult.cs (.../ValidationResult.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -57,7 +57,7 @@ /// /// Gets a value which indicates whether the validation subject is valid. /// - public bool IsValid { get; private set; } + public bool IsValid { get; } /// /// Gets the error messages resulting from the validation. Index: Ringtoets/Common/src/Ringtoets.Common.Service/ClearResults.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Service/ClearResults.cs (.../ClearResults.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Service/ClearResults.cs (.../ClearResults.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -54,11 +54,11 @@ /// /// The changed objects. /// - public IEnumerable ChangedObjects { get; private set; } + public IEnumerable ChangedObjects { get; } /// /// The removed objects. /// - public IEnumerable RemovedObjects { get; private set; } + public IEnumerable RemovedObjects { get; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Service/IllustrationPoints/FaultTreeIllustrationPointConverter.cs =================================================================== diff -u -r624182c7e9be3e758f0c6a55e360edac0892d48e -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Service/IllustrationPoints/FaultTreeIllustrationPointConverter.cs (.../FaultTreeIllustrationPointConverter.cs) (revision 624182c7e9be3e758f0c6a55e360edac0892d48e) +++ Ringtoets/Common/src/Ringtoets.Common.Service/IllustrationPoints/FaultTreeIllustrationPointConverter.cs (.../FaultTreeIllustrationPointConverter.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -61,9 +61,9 @@ .Stochasts.Select(StochastConverter.Convert); return new FaultTreeIllustrationPoint(hydraRingFaultTreeIllustrationPoint.Name, - hydraRingFaultTreeIllustrationPoint.Beta, - stochasts, - combinationType); + hydraRingFaultTreeIllustrationPoint.Beta, + stochasts, + combinationType); } catch (Exception e) when (e is NotSupportedException || e is InvalidEnumArgumentException) { Index: Ringtoets/Common/src/Ringtoets.Common.Service/IllustrationPoints/GeneralResultConverter.cs =================================================================== diff -u -rc77ccbb8b26516270f36ef53110be573839f3470 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Service/IllustrationPoints/GeneralResultConverter.cs (.../GeneralResultConverter.cs) (revision c77ccbb8b26516270f36ef53110be573839f3470) +++ Ringtoets/Common/src/Ringtoets.Common.Service/IllustrationPoints/GeneralResultConverter.cs (.../GeneralResultConverter.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -90,7 +90,7 @@ { var topLevelIlustrationPoints = new List(); foreach (KeyValuePair topLevelIllustrationPointTreeNode in hydraRingTopLevelIllustrationPoints) + HydraRingIllustrationPointTreeNode> topLevelIllustrationPointTreeNode in hydraRingTopLevelIllustrationPoints) { IHydraRingIllustrationPoint hydraIllustrationPointData = topLevelIllustrationPointTreeNode.Value.Data; HydraRingWindDirectionClosingSituation hydraWindDirectionClosingSituation = topLevelIllustrationPointTreeNode.Key; @@ -162,7 +162,7 @@ { var topLevelIllustrationPoints = new List(); foreach (KeyValuePair hydraRingillustrationPointTreeNode in hydraRingTopLevelIllustrationPoints) + HydraRingIllustrationPointTreeNode> hydraRingillustrationPointTreeNode in hydraRingTopLevelIllustrationPoints) { HydraRingIllustrationPointTreeNode hydraRingIllustrationPointTreeNode = hydraRingillustrationPointTreeNode.Value; IHydraRingIllustrationPoint hydraIllustrationPointData = hydraRingIllustrationPointTreeNode.Data; Index: Ringtoets/Common/src/Ringtoets.Common.Utils/CalculationWithLocation.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Utils/CalculationWithLocation.cs (.../CalculationWithLocation.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Utils/CalculationWithLocation.cs (.../CalculationWithLocation.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -56,11 +56,11 @@ /// /// Gets the calculation which has a location assigned. /// - public ICalculation Calculation { get; private set; } + public ICalculation Calculation { get; } /// /// Gets the location of the calculation. /// - public Point2D Location { get; private set; } + public Point2D Location { get; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Utils/SectionSegments.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/src/Ringtoets.Common.Utils/SectionSegments.cs (.../SectionSegments.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Utils/SectionSegments.cs (.../SectionSegments.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -53,7 +53,7 @@ /// /// Gets the . /// - public FailureMechanismSection Section { get; private set; } + public FailureMechanismSection Section { get; } /// /// Calculate the Euclidean distance between the and a . Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/DikeProfiles/DikeProfileTest.cs =================================================================== diff -u -rec27d9f02dc27c2829ed45788fae7d5923d63d3d -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/DikeProfiles/DikeProfileTest.cs (.../DikeProfileTest.cs) (revision ec27d9f02dc27c2829ed45788fae7d5923d63d3d) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/DikeProfiles/DikeProfileTest.cs (.../DikeProfileTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -868,8 +868,7 @@ Id = profile.Id, Orientation = profile.Orientation, X0 = profile.X0 - }) - { } + }) {} } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/IllustrationPoints/FaultTreeIllustrationPointExtensionsTest.cs =================================================================== diff -u -r5899c392963028438e1f12b64d21373b71866852 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/IllustrationPoints/FaultTreeIllustrationPointExtensionsTest.cs (.../FaultTreeIllustrationPointExtensionsTest.cs) (revision 5899c392963028438e1f12b64d21373b71866852) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/IllustrationPoints/FaultTreeIllustrationPointExtensionsTest.cs (.../FaultTreeIllustrationPointExtensionsTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -21,7 +21,6 @@ using System; using System.Collections.Generic; -using System.Linq; using NUnit.Framework; using Ringtoets.Common.Data.IllustrationPoints; using Ringtoets.Common.Data.TestUtil.IllustrationPoints; Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/IllustrationPoints/IllustrationPointBaseTest.cs =================================================================== diff -u -r268c1647f0094f6c43aeceaa5793437562cffe5a -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/IllustrationPoints/IllustrationPointBaseTest.cs (.../IllustrationPointBaseTest.cs) (revision 268c1647f0094f6c43aeceaa5793437562cffe5a) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/IllustrationPoints/IllustrationPointBaseTest.cs (.../IllustrationPointBaseTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -46,13 +46,13 @@ { // Setup const string name = "Illustration Point Name"; - + var random = new Random(21); double beta = random.NextDouble(); // Call var illustrationPoint = new TestIllustrationPointBase(name, beta); - + // Assert Assert.IsInstanceOf(illustrationPoint); Assert.AreEqual(name, illustrationPoint.Name); @@ -76,7 +76,7 @@ private class TestIllustrationPointBase : IllustrationPointBase { - public TestIllustrationPointBase(string name, double beta) + public TestIllustrationPointBase(string name, double beta) : base(name, beta) {} } } Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/IllustrationPoints/SubMechanismIllustrationPointTest.cs =================================================================== diff -u -rd64218a12ee9c2fd3ffb32134354f694d77dedbe -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/IllustrationPoints/SubMechanismIllustrationPointTest.cs (.../SubMechanismIllustrationPointTest.cs) (revision d64218a12ee9c2fd3ffb32134354f694d77dedbe) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/IllustrationPoints/SubMechanismIllustrationPointTest.cs (.../SubMechanismIllustrationPointTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -117,7 +117,6 @@ public void Constructor_StochastNamesNotUnique_ThrowArgumentException() { // Setup - var random = new Random(21); var stochasts = new[] { new SubMechanismIllustrationPointStochast("unique", 0, 0, 0), Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Structures/StructuresFailureMechanismSectionResultTest.cs =================================================================== diff -u -rf4049b9b0967513aeadfddb1fe58efa3b3aa1677 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Structures/StructuresFailureMechanismSectionResultTest.cs (.../StructuresFailureMechanismSectionResultTest.cs) (revision f4049b9b0967513aeadfddb1fe58efa3b3aa1677) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Structures/StructuresFailureMechanismSectionResultTest.cs (.../StructuresFailureMechanismSectionResultTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Geometry; using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/FaultTreeIllustrationPointTestFactoryTest.cs =================================================================== diff -u -r57b198a3f80256e02b871d8de11c05d9f2dcf311 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/FaultTreeIllustrationPointTestFactoryTest.cs (.../FaultTreeIllustrationPointTestFactoryTest.cs) (revision 57b198a3f80256e02b871d8de11c05d9f2dcf311) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/FaultTreeIllustrationPointTestFactoryTest.cs (.../FaultTreeIllustrationPointTestFactoryTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -30,7 +30,7 @@ public class FaultTreeIllustrationPointTestFactoryTest { [Test] - public void CreateTestFaultTreeIllustrationPoint_ReturnsExpectedProperties() + public void CreateTestFaultTreeIllustrationPoint_DefaultBeta_ReturnsExpectedProperties() { // Call FaultTreeIllustrationPoint illustrationPoint = FaultTreeIllustrationPointTestFactory.CreateTestFaultTreeIllustrationPoint(); @@ -45,7 +45,7 @@ } [Test] - public void CreateTestFaultTreeIllustrationPoint_ValidParameter_ReturnsExpectedProperties() + public void CreateTestFaultTreeIllustrationPoint_WithBeta_ReturnsExpectedProperties() { // Setup double beta = new Random().NextDouble(); Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/TestGeneralResultSubMechanismIllustrationPointTest.cs =================================================================== diff -u -rb980005d38347be63445eae4223e5d9fa2dc0395 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/TestGeneralResultSubMechanismIllustrationPointTest.cs (.../TestGeneralResultSubMechanismIllustrationPointTest.cs) (revision b980005d38347be63445eae4223e5d9fa2dc0395) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/TestGeneralResultSubMechanismIllustrationPointTest.cs (.../TestGeneralResultSubMechanismIllustrationPointTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -47,7 +47,7 @@ public void Constructor_TopLevelSubMechanismIllustrationPoint_ExpectedProperties() { // Setup - IEnumerable topLevelIllustrationPoints = + IEnumerable topLevelIllustrationPoints = Enumerable.Empty(); // Call Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/TestSubMechanismIllustrationPointStochastTest.cs =================================================================== diff -u -r82beae540257b0a91094838c1a020d043431a93a -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/TestSubMechanismIllustrationPointStochastTest.cs (.../TestSubMechanismIllustrationPointStochastTest.cs) (revision 82beae540257b0a91094838c1a020d043431a93a) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/TestSubMechanismIllustrationPointStochastTest.cs (.../TestSubMechanismIllustrationPointStochastTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -36,7 +36,7 @@ // Call var stochast = new TestSubMechanismIllustrationPointStochast(name, alpha); - + // Assert Assert.AreEqual(name, stochast.Name); Assert.AreEqual(alpha, stochast.Alpha); Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestStructureTest.cs =================================================================== diff -u -r6a28e1aa3e370ae901e184ce6b511b0271228d13 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestStructureTest.cs (.../TestStructureTest.cs) (revision 6a28e1aa3e370ae901e184ce6b511b0271228d13) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestStructureTest.cs (.../TestStructureTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -45,7 +45,7 @@ } [Test] - public void Constructor_WithId_ExpectedProperties() + public void Constructor_WithIdAndDefaultName_ExpectedProperties() { // Setup const string id = "some Id"; Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/IllustrationPoints/FaultTreeIllustrationPointTestFactory.cs =================================================================== diff -u -r57b198a3f80256e02b871d8de11c05d9f2dcf311 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/IllustrationPoints/FaultTreeIllustrationPointTestFactory.cs (.../FaultTreeIllustrationPointTestFactory.cs) (revision 57b198a3f80256e02b871d8de11c05d9f2dcf311) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/IllustrationPoints/FaultTreeIllustrationPointTestFactory.cs (.../FaultTreeIllustrationPointTestFactory.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -31,21 +31,11 @@ { /// /// Creates a new instance of with arbitrary value - /// for and beta. - /// - /// The created . - public static FaultTreeIllustrationPoint CreateTestFaultTreeIllustrationPoint() - { - return CreateTestFaultTreeIllustrationPoint(1.23); - } - - /// - /// Creates a new instance of with arbitrary value /// for . /// /// The beta value of the illustration point. /// The created . - public static FaultTreeIllustrationPoint CreateTestFaultTreeIllustrationPoint(double beta) + public static FaultTreeIllustrationPoint CreateTestFaultTreeIllustrationPoint(double beta = 1.23) { return CreateTestFaultTreeIllustrationPointCombinationTypeAnd(beta); } Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/IllustrationPoints/TestSubMechanismIllustrationPointStochast.cs =================================================================== diff -u -rb7988d7a5616c8c305dac4419a15d5eda07e88bc -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/IllustrationPoints/TestSubMechanismIllustrationPointStochast.cs (.../TestSubMechanismIllustrationPointStochast.cs) (revision b7988d7a5616c8c305dac4419a15d5eda07e88bc) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/IllustrationPoints/TestSubMechanismIllustrationPointStochast.cs (.../TestSubMechanismIllustrationPointStochast.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -33,7 +33,7 @@ /// /// The name of the stochast. /// The alpha value of the stochast. - public TestSubMechanismIllustrationPointStochast(string name, double alpha) + public TestSubMechanismIllustrationPointStochast(string name, double alpha) : base(name, 1, alpha, 3) {} } -} +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestCalculationWithForeshoreProfile.cs =================================================================== diff -u -r07f3d67fe9512b3c8303ff09398b0a234900d546 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestCalculationWithForeshoreProfile.cs (.../TestCalculationWithForeshoreProfile.cs) (revision 07f3d67fe9512b3c8303ff09398b0a234900d546) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestCalculationWithForeshoreProfile.cs (.../TestCalculationWithForeshoreProfile.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -103,11 +103,24 @@ HasOutput = false; } + public object Clone() + { + throw new NotImplementedException(); + } + /// /// A simple input class with a . /// public class TestCalculationInputWithForeshoreProfile : ICalculationInput, IUseForeshore, IHasForeshoreProfile { + public IEnumerable Observers + { + get + { + throw new NotImplementedException(); + } + } + public ForeshoreProfile ForeshoreProfile { get; set; } public bool IsForeshoreProfileInputSynchronized { get; } @@ -122,14 +135,6 @@ } } - public IEnumerable Observers - { - get - { - throw new NotImplementedException(); - } - } - public void Attach(IObserver observer) { throw new NotImplementedException(); @@ -150,10 +155,5 @@ throw new NotImplementedException(); } } - - public object Clone() - { - throw new NotImplementedException(); - } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestStructure.cs =================================================================== diff -u -rdf53f0268b7c15f000796a38436b2c40069b9b07 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestStructure.cs (.../TestStructure.cs) (revision df53f0268b7c15f000796a38436b2c40069b9b07) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestStructure.cs (.../TestStructure.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -40,19 +40,10 @@ /// Creates a new instance of . /// /// The id of the structure. - /// Thrown when - /// is null, empty or consists of whitespace. - public TestStructure(string id) - : this(id, "name") {} - - /// - /// Creates a new instance of . - /// - /// The id of the structure. /// The name of the structure. /// Thrown when or /// is null, empty or consists of only whitespaces. - public TestStructure(string id, string name) + public TestStructure(string id, string name = "name") : this(id, name, new Point2D(0.0, 0.0)) {} /// Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/ChangeHandlers/FailureMechanismPropertyChangeHandlerTest.cs =================================================================== diff -u -r1b691808bc6321dcabd7ac123b5d8f2043aed602 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/ChangeHandlers/FailureMechanismPropertyChangeHandlerTest.cs (.../FailureMechanismPropertyChangeHandlerTest.cs) (revision 1b691808bc6321dcabd7ac123b5d8f2043aed602) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/ChangeHandlers/FailureMechanismPropertyChangeHandlerTest.cs (.../FailureMechanismPropertyChangeHandlerTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -143,9 +143,10 @@ Assert.AreEqual(expectedMessage, message); } Assert.AreEqual(1, propertySet); - var expectedAffectedObjects = new List(testCase.ExpectedAffectedCalculations); - expectedAffectedObjects.Add(testFailureMechanism); - CollectionAssert.AreEqual(expectedAffectedObjects, affectedObjects); + CollectionAssert.AreEqual(new List(testCase.ExpectedAffectedCalculations) + { + testFailureMechanism + }, affectedObjects); Assert.IsTrue(testCase.Calculations.All(c => !c.HasOutput)); } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/ChangeHandlers/PropertyChangeHelperTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/ChangeHandlers/PropertyChangeHelperTest.cs (.../PropertyChangeHelperTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/ChangeHandlers/PropertyChangeHelperTest.cs (.../PropertyChangeHelperTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -53,7 +53,7 @@ public void ChangePropertyAndNotify_WithoutChangeHandler_ThrowsArgumentNullException() { // Call - TestDelegate test = () => PropertyChangeHelper.ChangePropertyAndNotify(() => { }, null); + TestDelegate test = () => PropertyChangeHelper.ChangePropertyAndNotify(() => {}, null); // Assert var exception = Assert.Throws(test); @@ -64,7 +64,7 @@ public void ChangePropertyAndNotify_ChangeHasNoAffectedObjects_HandlerUsedForSetAction() { // Setup - SetObservablePropertyValueDelegate setAction = () => { }; + SetObservablePropertyValueDelegate setAction = () => {}; var mocks = new MockRepository(); var handler = mocks.StrictMock(); @@ -82,7 +82,7 @@ public void ChangePropertyAndNotify_ChangeHasAffectedObjects_AffectedObjectsNotified() { // Setup - SetObservablePropertyValueDelegate setAction = () => { }; + SetObservablePropertyValueDelegate setAction = () => {}; var mocks = new MockRepository(); var observableA = mocks.StrictMock(); Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/ForeshoreProfilesContextTest.cs =================================================================== diff -u -red4b032b9903f394deb9691c2c39a9f2122ab0f5 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/ForeshoreProfilesContextTest.cs (.../ForeshoreProfilesContextTest.cs) (revision ed4b032b9903f394deb9691c2c39a9f2122ab0f5) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/ForeshoreProfilesContextTest.cs (.../ForeshoreProfilesContextTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base; using Core.Common.Controls.PresentationObjects; using NUnit.Framework; using Rhino.Mocks; Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/SelectableHydraulicBoundaryLocationTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/SelectableHydraulicBoundaryLocationTest.cs (.../SelectableHydraulicBoundaryLocationTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/SelectableHydraulicBoundaryLocationTest.cs (.../SelectableHydraulicBoundaryLocationTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -268,8 +268,8 @@ double distance = location.Location.GetEuclideanDistanceTo(referencePoint); return distance / 1000 < 1 - ? string.Format("{0} ({1:f0} m)", location.Name, distance) - : string.Format("{0} ({1:f1} km)", location.Name, distance / 1000); + ? $"{location.Name} ({distance:f0} m)" + : $"{location.Name} ({distance / 1000:f1} km)"; } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/DistributionPropertiesBaseTest.cs =================================================================== diff -u -rbcdabbbbd7fae323c339fdabc8bcb390962ccbcc -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/DistributionPropertiesBaseTest.cs (.../DistributionPropertiesBaseTest.cs) (revision bcdabbbbd7fae323c339fdabc8bcb390962ccbcc) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/DistributionPropertiesBaseTest.cs (.../DistributionPropertiesBaseTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -175,10 +175,7 @@ // Assert Assert.AreEqual(distribution.Mean, properties.Mean); Assert.AreEqual(distribution.StandardDeviation, properties.StandardDeviation); - string expectedToString = string.Format("{0} ({1} = {2})", - distribution.Mean, - Resources.NormalDistribution_StandardDeviation_DisplayName, - distribution.StandardDeviation); + string expectedToString = $"{distribution.Mean} ({Resources.NormalDistribution_StandardDeviation_DisplayName} = {distribution.StandardDeviation})"; Assert.AreEqual(expectedToString, properties.ToString()); mocks.VerifyAll(); } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/IllustrationPointPropertiesTest.cs =================================================================== diff -u -ra49798da6ac2176d2e8b28ec6fec8a2494d8ee91 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/IllustrationPointPropertiesTest.cs (.../IllustrationPointPropertiesTest.cs) (revision a49798da6ac2176d2e8b28ec6fec8a2494d8ee91) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/IllustrationPointPropertiesTest.cs (.../IllustrationPointPropertiesTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -22,7 +22,6 @@ using System; using System.ComponentModel; using System.Linq; -using Core.Common.Gui.Converters; using Core.Common.TestUtil; using Core.Common.Utils; using NUnit.Framework; @@ -49,7 +48,7 @@ { // Call TestDelegate test = () => new IllustrationPointProperties(null, - "Point name A", + "Point name A", "Closing Situation"); // Assert Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/UseBreakWaterPropertiesTest.cs =================================================================== diff -u -rd485f27eb5a6d688406882dce60c3229e22f2ac2 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/UseBreakWaterPropertiesTest.cs (.../UseBreakWaterPropertiesTest.cs) (revision d485f27eb5a6d688406882dce60c3229e22f2ac2) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/UseBreakWaterPropertiesTest.cs (.../UseBreakWaterPropertiesTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -193,23 +193,23 @@ { RoundedDouble breakWaterHeight = new Random(21).NextRoundedDouble(); SetPropertyAndVerifyNotificationsAndOutputForCalculation(properties => properties.BreakWaterHeight = breakWaterHeight, - new TestUseBreakWater()); + new TestUseBreakWater()); } [Test] public void BreakWaterType_Always_InputNotifiedAndPropertyChangedCalled() { var type = new Random(21).NextEnumValue(); SetPropertyAndVerifyNotificationsAndOutputForCalculation(properties => properties.BreakWaterType = type, - new TestUseBreakWater()); + new TestUseBreakWater()); } [Test] public void UseBreakWater_Always_InputNotifiedAndPropertyChangedCalled() { bool useBreakWater = new Random(21).NextBoolean(); SetPropertyAndVerifyNotificationsAndOutputForCalculation(properties => properties.UseBreakWater = useBreakWater, - new TestUseBreakWater()); + new TestUseBreakWater()); } private class TestUseBreakWater : Observable, ICalculationInput, IUseBreakWater Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/UseForeshorePropertiesTest.cs =================================================================== diff -u -rd485f27eb5a6d688406882dce60c3229e22f2ac2 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/UseForeshorePropertiesTest.cs (.../UseForeshorePropertiesTest.cs) (revision d485f27eb5a6d688406882dce60c3229e22f2ac2) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/UseForeshorePropertiesTest.cs (.../UseForeshorePropertiesTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -143,7 +143,7 @@ { bool useForeshore = new Random(21).NextBoolean(); SetPropertyAndVerifyNotificationsAndOutputForCalculation(properties => properties.UseForeshore = useForeshore, - new TestUseForeshore()); + new TestUseForeshore()); } [TestCase(0, false)] Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/VariationCoefficientDistributionPropertiesBaseTest.cs =================================================================== diff -u -rbcdabbbbd7fae323c339fdabc8bcb390962ccbcc -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/VariationCoefficientDistributionPropertiesBaseTest.cs (.../VariationCoefficientDistributionPropertiesBaseTest.cs) (revision bcdabbbbd7fae323c339fdabc8bcb390962ccbcc) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/VariationCoefficientDistributionPropertiesBaseTest.cs (.../VariationCoefficientDistributionPropertiesBaseTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -177,10 +177,7 @@ // Assert Assert.AreEqual(distribution.Mean, properties.Mean); Assert.AreEqual(distribution.CoefficientOfVariation, properties.CoefficientOfVariation); - string expectedToString = string.Format("{0} ({1} = {2})", - distribution.Mean, - Resources.Distribution_VariationCoefficient_DisplayName, - distribution.CoefficientOfVariation); + string expectedToString = $"{distribution.Mean} ({Resources.Distribution_VariationCoefficient_DisplayName} = {distribution.CoefficientOfVariation})"; Assert.AreEqual(expectedToString, properties.ToString()); mocks.VerifyAll(); } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/TreeNodeInfos/RingtoetsTreeNodeInfoFactoryTest.cs =================================================================== diff -u -r17b11c850b35c3ea99150ba25098b5b769b58f4f -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/TreeNodeInfos/RingtoetsTreeNodeInfoFactoryTest.cs (.../RingtoetsTreeNodeInfoFactoryTest.cs) (revision 17b11c850b35c3ea99150ba25098b5b769b58f4f) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/TreeNodeInfos/RingtoetsTreeNodeInfoFactoryTest.cs (.../RingtoetsTreeNodeInfoFactoryTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -49,7 +49,7 @@ // Setup Func childNodeObjects = context => new object[0]; Func contextMenuStrip = (context, parent, treeViewControl) => new ContextMenuStrip(); - Action onNodeRemoved = (context, parent) => { }; + Action onNodeRemoved = (context, parent) => {}; // Call TreeNodeInfo treeNodeInfo = RingtoetsTreeNodeInfoFactory.CreateCalculationGroupContextTreeNodeInfo(childNodeObjects, contextMenuStrip, onNodeRemoved); @@ -594,7 +594,7 @@ Bitmap icon = RingtoetsFormsResources.CalculationIcon; Func childNodeObjects = context => new object[0]; Func contextMenuStrip = (context, parent, treeViewControl) => new ContextMenuStrip(); - Action onNodeRemoved = (context, parent) => { }; + Action onNodeRemoved = (context, parent) => {}; // Call TreeNodeInfo treeNodeInfo = RingtoetsTreeNodeInfoFactory.CreateCalculationContextTreeNodeInfo(childNodeObjects, contextMenuStrip, onNodeRemoved); Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismResultViewTest.cs =================================================================== diff -u -rb7ceb01aa02cd6f48334150f867a397314ceba3e -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismResultViewTest.cs (.../FailureMechanismResultViewTest.cs) (revision b7ceb01aa02cd6f48334150f867a397314ceba3e) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismResultViewTest.cs (.../FailureMechanismResultViewTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -150,6 +150,6 @@ Name = sectionResult.Section.Name; } - public string Name { get; private set; } + public string Name { get; } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/IllustrationPointRowTest.cs =================================================================== diff -u -rf288f9ccb9ac465f017170a59279909d8431fdc7 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/IllustrationPointRowTest.cs (.../IllustrationPointRowTest.cs) (revision f288f9ccb9ac465f017170a59279909d8431fdc7) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/IllustrationPointRowTest.cs (.../IllustrationPointRowTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -81,7 +81,6 @@ Assert.AreEqual(expectedProbability, row.Probability); Assert.AreEqual(beta, row.Reliability); Assert.AreEqual(nrOfDecimals, row.Reliability.NumberOfDecimalPlaces); - } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/FailureMechanismSetPropertyValueAfterConfirmationParameterTesterTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/FailureMechanismSetPropertyValueAfterConfirmationParameterTesterTest.cs (.../FailureMechanismSetPropertyValueAfterConfirmationParameterTesterTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/FailureMechanismSetPropertyValueAfterConfirmationParameterTesterTest.cs (.../FailureMechanismSetPropertyValueAfterConfirmationParameterTesterTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -66,7 +66,7 @@ expectedFailureMechanism, value, Enumerable.Empty()); // Call - TestDelegate test = () => tester.SetPropertyValueAfterConfirmation(passedFailureMechanism, value, (m, v) => { }); + TestDelegate test = () => tester.SetPropertyValueAfterConfirmation(passedFailureMechanism, value, (m, v) => {}); // Assert Assert.Throws(test); @@ -86,7 +86,7 @@ expectedFailureMechanism, expectedValue, Enumerable.Empty()); // Call - TestDelegate test = () => tester.SetPropertyValueAfterConfirmation(expectedFailureMechanism, passedValue, (m, v) => { }); + TestDelegate test = () => tester.SetPropertyValueAfterConfirmation(expectedFailureMechanism, passedValue, (m, v) => {}); // Assert Assert.Throws(test); Index: Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/IllustrationPointControlItemComparer.cs =================================================================== diff -u -rf288f9ccb9ac465f017170a59279909d8431fdc7 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/IllustrationPointControlItemComparer.cs (.../IllustrationPointControlItemComparer.cs) (revision f288f9ccb9ac465f017170a59279909d8431fdc7) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/IllustrationPointControlItemComparer.cs (.../IllustrationPointControlItemComparer.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -33,6 +33,19 @@ /// because the order is normally undefined when determining reference equality. public class IllustrationPointControlItemComparer : IComparer, IComparer { + public int Compare(object x, object y) + { + var lhs = x as IllustrationPointControlItem; + var rhs = y as IllustrationPointControlItem; + if (lhs == null || rhs == null) + { + throw new ArgumentException("Arguments must be of type 'IllustrationPointControlItem', but found:" + + $"x: {x.GetType()} and y: {y.GetType()}"); + } + + return Compare(lhs, rhs); + } + public int Compare(IllustrationPointControlItem x, IllustrationPointControlItem y) { if (!ReferenceEquals(x?.Source, y?.Source)) @@ -54,18 +67,5 @@ return x.Beta.CompareTo(y.Beta); } - - public int Compare(object x, object y) - { - var lhs = x as IllustrationPointControlItem; - var rhs = y as IllustrationPointControlItem; - if (lhs == null || rhs == null) - { - throw new ArgumentException("Arguments must be of type 'IllustrationPointControlItem', but found:" + - $"x: {x.GetType()} and y: {y.GetType()}"); - } - - return Compare(lhs, rhs); - } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/StructuresCalculationStochastAssignerTest.cs =================================================================== diff -u -r89bea52ae1b4639721b93bdd4a537f36ec6d6b9c -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/StructuresCalculationStochastAssignerTest.cs (.../StructuresCalculationStochastAssignerTest.cs) (revision 89bea52ae1b4639721b93bdd4a537f36ec6d6b9c) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/StructuresCalculationStochastAssignerTest.cs (.../StructuresCalculationStochastAssignerTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -197,23 +197,17 @@ { StandardDeviationStochasts = new[] { - new StructuresCalculationStochastAssigner< - StructuresCalculationConfiguration, - SimpleStructuresInput, - StructureBase>.StandardDeviationDefinition(stochastName, - standardDeviationStochastConfiguration, - input => null, - (input, distribution) => { }) + new StructuresCalculationStochastAssigner.StandardDeviationDefinition(stochastName, + standardDeviationStochastConfiguration, + input => null, + (input, distribution) => {}) }, VariationCoefficientStochasts = new[] { - new StructuresCalculationStochastAssigner< - StructuresCalculationConfiguration, - SimpleStructuresInput, - StructureBase>.VariationCoefficientDefinition(stochastName, - variationCoefficientStochastConfiguration, - input => null, - (input, distribution) => { }) + new StructuresCalculationStochastAssigner.VariationCoefficientDefinition(stochastName, + variationCoefficientStochastConfiguration, + input => null, + (input, distribution) => {}) } }; @@ -260,23 +254,17 @@ { StandardDeviationStochasts = new[] { - new StructuresCalculationStochastAssigner< - StructuresCalculationConfiguration, - SimpleStructuresInput, - StructureBase>.StandardDeviationDefinition(stochastName, - standardDeviationStochastConfiguration, - input => new LogNormalDistribution(), - (input, distribution) => { }) + new StructuresCalculationStochastAssigner.StandardDeviationDefinition(stochastName, + standardDeviationStochastConfiguration, + input => new LogNormalDistribution(), + (input, distribution) => {}) }, VariationCoefficientStochasts = new[] { - new StructuresCalculationStochastAssigner< - StructuresCalculationConfiguration, - SimpleStructuresInput, - StructureBase>.VariationCoefficientDefinition(stochastName, - variationCoefficientStochastConfiguration, - input => new VariationCoefficientLogNormalDistribution(), - (input, distribution) => { }) + new StructuresCalculationStochastAssigner.VariationCoefficientDefinition(stochastName, + variationCoefficientStochastConfiguration, + input => new VariationCoefficientLogNormalDistribution(), + (input, distribution) => {}) } }; @@ -325,22 +313,16 @@ }; var definitionA = - new StructuresCalculationStochastAssigner< - StructuresCalculationConfiguration, - SimpleStructuresInput, - StructureBase>.StandardDeviationDefinition("stochastA", - standardDeviationStochastConfiguration, - input => input.AllowedLevelIncreaseStorage, - (input, distribution) => { input.AllowedLevelIncreaseStorage = (LogNormalDistribution) distribution; }); + new StructuresCalculationStochastAssigner.StandardDeviationDefinition("stochastA", + standardDeviationStochastConfiguration, + input => input.AllowedLevelIncreaseStorage, + (input, distribution) => { input.AllowedLevelIncreaseStorage = (LogNormalDistribution) distribution; }); var definitionB = - new StructuresCalculationStochastAssigner< - StructuresCalculationConfiguration, - SimpleStructuresInput, - StructureBase>.VariationCoefficientDefinition("stochastB", - variationCoefficientStochastConfiguration, - input => input.CriticalOvertoppingDischarge, - (input, distribution) => { input.CriticalOvertoppingDischarge = (VariationCoefficientLogNormalDistribution) distribution; }); + new StructuresCalculationStochastAssigner.VariationCoefficientDefinition("stochastB", + variationCoefficientStochastConfiguration, + input => input.CriticalOvertoppingDischarge, + (input, distribution) => { input.CriticalOvertoppingDischarge = (VariationCoefficientLogNormalDistribution) distribution; }); var assigner = new SimpleStructuresCalculationStochastAssigner( configuration, @@ -386,14 +368,13 @@ { // Setup var getter = new Func(i => null); - var setter = new Action((i, d) => { }); + var setter = new Action((i, d) => {}); // Call - TestDelegate test = () => new StructuresCalculationStochastAssigner - .StandardDeviationDefinition(null, - null, - getter, - setter); + TestDelegate test = () => new StructuresCalculationStochastAssigner.StandardDeviationDefinition(null, + null, + getter, + setter); // Assert var exception = Assert.Throws(test); @@ -406,14 +387,13 @@ // Setup const string stochastName = ""; var configuration = new StochastConfiguration(); - var setter = new Action((i, d) => { }); + var setter = new Action((i, d) => {}); // Call - TestDelegate test = () => new StructuresCalculationStochastAssigner - .StandardDeviationDefinition(stochastName, - configuration, - null, - setter); + TestDelegate test = () => new StructuresCalculationStochastAssigner.StandardDeviationDefinition(stochastName, + configuration, + null, + setter); // Assert var exception = Assert.Throws(test); @@ -428,11 +408,10 @@ var getter = new Func(i => null); // Call - TestDelegate test = () => new StructuresCalculationStochastAssigner - .StandardDeviationDefinition(stochastName, - null, - getter, - null); + TestDelegate test = () => new StructuresCalculationStochastAssigner.StandardDeviationDefinition(stochastName, + null, + getter, + null); // Assert var exception = Assert.Throws(test); @@ -452,15 +431,14 @@ configuration = new StochastConfiguration(); } var getter = new Func(i => null); - var setter = new Action((i, d) => { }); + var setter = new Action((i, d) => {}); // Call var definition = - new StructuresCalculationStochastAssigner - .StandardDeviationDefinition(stochastName, - configuration, - getter, - setter); + new StructuresCalculationStochastAssigner.StandardDeviationDefinition(stochastName, + configuration, + getter, + setter); // Assert Assert.NotNull(definition); @@ -479,14 +457,13 @@ { // Setup var getter = new Func(i => null); - var setter = new Action((i, d) => { }); + var setter = new Action((i, d) => {}); // Call - TestDelegate test = () => new StructuresCalculationStochastAssigner - .VariationCoefficientDefinition(null, - null, - getter, - setter); + TestDelegate test = () => new StructuresCalculationStochastAssigner.VariationCoefficientDefinition(null, + null, + getter, + setter); // Assert var exception = Assert.Throws(test); @@ -498,15 +475,14 @@ { // Setup const string stochastName = ""; - var setter = new Action((i, d) => { }); + var setter = new Action((i, d) => {}); // Call TestDelegate test = () => - new StructuresCalculationStochastAssigner - .VariationCoefficientDefinition(stochastName, - null, - null, - setter); + new StructuresCalculationStochastAssigner.VariationCoefficientDefinition(stochastName, + null, + null, + setter); // Assert var exception = Assert.Throws(test); @@ -522,11 +498,10 @@ // Call TestDelegate test = () => - new StructuresCalculationStochastAssigner - .VariationCoefficientDefinition(stochastName, - null, - getter, - null); + new StructuresCalculationStochastAssigner.VariationCoefficientDefinition(stochastName, + null, + getter, + null); // Assert var exception = Assert.Throws(test); @@ -546,15 +521,14 @@ configuration = new StochastConfiguration(); } var getter = new Func(i => null); - var setter = new Action((i, d) => { }); + var setter = new Action((i, d) => {}); // Call var definition = - new StructuresCalculationStochastAssigner - .VariationCoefficientDefinition(stochastName, - configuration, - getter, - setter); + new StructuresCalculationStochastAssigner.VariationCoefficientDefinition(stochastName, + configuration, + getter, + setter); // Assert Assert.NotNull(definition); @@ -607,22 +581,22 @@ { yield return new TestCaseData( new Action(c => c.Mean = 3.2), - new Action(c => { }), + new Action(c => {}), "stochastA") .SetName(string.Format(testNameFormat, "WithStructureAndStandardDeviationStochastMeanSet")); yield return new TestCaseData( new Action(c => c.StandardDeviation = 3.2), - new Action(c => { }), + new Action(c => {}), "stochastB") .SetName(string.Format(testNameFormat, "WithStructureAndStandardDeviationStochastStandardDeviationSet")); yield return new TestCaseData( - new Action(c => { }), + new Action(c => {}), new Action(c => c.Mean = 3.2), "stochastD") .SetName(string.Format(testNameFormat, "WithStructureAndVariationCoefficientStochastMeanSet")); yield return new TestCaseData( - new Action(c => { }), + new Action(c => {}), new Action(c => c.VariationCoefficient = 3.2), "stochastF") .SetName(string.Format(testNameFormat, "WithStructureAndVariationCoefficientStochastVariationCoefficientSet")); Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/DikeProfiles/DikeProfileDataReaderTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/DikeProfiles/DikeProfileDataReaderTest.cs (.../DikeProfileDataReaderTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/DikeProfiles/DikeProfileDataReaderTest.cs (.../DikeProfileDataReaderTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -70,8 +70,7 @@ TestDelegate call = () => reader.ReadDikeProfileData(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet leeg of ongedefinieerd zijn.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': bestandspad mag niet leeg of ongedefinieerd zijn."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } @@ -109,8 +108,7 @@ TestDelegate call = () => reader.ReadDikeProfileData(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet verwijzen naar een lege bestandsnaam.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': bestandspad mag niet verwijzen naar een lege bestandsnaam."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } @@ -298,8 +296,7 @@ public void ReadDikeProfileData_FilesWithMissingParameters_ThrowCriticalFileReadException( string faultyFileName, string missingParameterNames) { - string expectedMessage = string.Format("de volgende parameters zijn niet aanwezig in het bestand: {0}", - missingParameterNames); + string expectedMessage = $"de volgende parameters zijn niet aanwezig in het bestand: {missingParameterNames}"; ReadFileAndExpectCriticalFileReadException("profiel001", faultyFileName, expectedMessage); } @@ -351,8 +348,7 @@ public void ReadDikeProfileData_FileWithDamTypeOutOfRange_ThrowCriticalFileReadException( string faultyFileName, int expectedDamInFile) { - string expectedMessage = string.Format("het ingelezen damtype ('{0}') moet 0, 1, 2 of 3 zijn.", - expectedDamInFile); + string expectedMessage = $"het ingelezen damtype ('{expectedDamInFile}') moet 0, 1, 2 of 3 zijn."; ReadFileAndExpectCriticalFileReadException("profiel001", faultyFileName, 6, expectedMessage); } @@ -362,8 +358,7 @@ public void ReadDikeProfileData_FileWithProfileTypeOutOfRange_ThrowCriticalFileReadException( string faultyFileName, int expectedDamInFile) { - string expectedMessage = string.Format("het ingelezen damwandtype ('{0}') moet '0', '1' of '2' zijn.", - expectedDamInFile); + string expectedMessage = $"het ingelezen damwandtype ('{expectedDamInFile}') moet '0', '1' of '2' zijn."; ReadFileAndExpectCriticalFileReadException("profiel001", faultyFileName, 11, expectedMessage); } @@ -415,8 +410,7 @@ public void ReadDikeProfileData_FileWithUnparsableId_ThrowCriticalFileReadException( string faultyFileName, string expectedReadText) { - string expectedMessage = string.Format("de ingelezen ID ('{0}') is ongeldig.", - expectedReadText); + string expectedMessage = $"de ingelezen ID ('{expectedReadText}') is ongeldig."; ReadFileAndExpectCriticalFileReadException("profiel001", faultyFileName, 2, expectedMessage); } @@ -443,8 +437,7 @@ public void ReadDikeProfileData_FileWithUnparsableOrientation_ThrowsCriticalFileReadException( string faultyFileName, string expectedReadText) { - string expectedMessage = string.Format("de ingelezen oriëntatie ('{0}') is geen getal.", - expectedReadText); + string expectedMessage = $"de ingelezen oriëntatie ('{expectedReadText}') is geen getal."; ReadFileAndExpectCriticalFileReadException("profiel001", faultyFileName, 4, expectedMessage); } @@ -454,8 +447,7 @@ public void ReadDikeProfileData_FileWithOverflowOrientation_ThrowsCriticalFileReadException( string faultyFileName, string expectedReadText) { - string expectedMessage = string.Format("de oriëntatie ('{0}') is te groot of te klein om ingelezen te worden.", - expectedReadText); + string expectedMessage = $"de oriëntatie ('{expectedReadText}') is te groot of te klein om ingelezen te worden."; ReadFileAndExpectCriticalFileReadException("profiel001", faultyFileName, 4, expectedMessage); } @@ -466,8 +458,7 @@ public void ReadDikeProfileData_FileWithUnparsableDamType_ThrowsCriticalFileReadException( string faultyFileName, string expectedReadText) { - string expectedMessage = string.Format("het ingelezen damtype ('{0}') moet 0, 1, 2 of 3 zijn.", - expectedReadText); + string expectedMessage = $"het ingelezen damtype ('{expectedReadText}') moet 0, 1, 2 of 3 zijn."; ReadFileAndExpectCriticalFileReadException("profiel005", faultyFileName, 6, expectedMessage); } @@ -477,8 +468,7 @@ public void ReadDikeProfileData_FileWithOverflowDamType_ThrowsCriticalFileReadException( string faultyFileName, string expectedReadText) { - string expectedMessage = string.Format("het ingelezen damtype ('{0}') moet 0, 1, 2 of 3 zijn.", - expectedReadText); + string expectedMessage = $"het ingelezen damtype ('{expectedReadText}') moet 0, 1, 2 of 3 zijn."; ReadFileAndExpectCriticalFileReadException("profiel005", faultyFileName, 6, expectedMessage); } @@ -489,8 +479,7 @@ public void ReadDikeProfileData_FileWithUnparsableProfileType_ThrowsCriticalFileReadException( string faultyFileName, string expectedReadText) { - string expectedMessage = string.Format("het ingelezen damwandtype ('{0}') moet '0', '1' of '2' zijn.", - expectedReadText); + string expectedMessage = $"het ingelezen damwandtype ('{expectedReadText}') moet '0', '1' of '2' zijn."; ReadFileAndExpectCriticalFileReadException("profiel001", faultyFileName, 11, expectedMessage); } @@ -500,8 +489,7 @@ public void ReadDikeProfileData_FileWithOverflowProfileType_ThrowsCriticalFileReadException( string faultyFileName, string expectedReadText) { - string expectedMessage = string.Format("het ingelezen damwandtype ('{0}') moet '0', '1' of '2' zijn.", - expectedReadText); + string expectedMessage = $"het ingelezen damwandtype ('{expectedReadText}') moet '0', '1' of '2' zijn."; ReadFileAndExpectCriticalFileReadException("profiel001", faultyFileName, 11, expectedMessage); } @@ -512,8 +500,7 @@ public void ReadDikeProfileData_FileWithUnparsableDamHeight_ThrowsCriticalFileReadException( string faultyFileName, string expectedReadText) { - string expectedMessage = string.Format("de ingelezen damhoogte ('{0}') is geen getal.", - expectedReadText); + string expectedMessage = $"de ingelezen damhoogte ('{expectedReadText}') is geen getal."; ReadFileAndExpectCriticalFileReadException("profiel001", faultyFileName, 7, expectedMessage); } @@ -523,8 +510,7 @@ public void ReadDikeProfileData_FileWithOverflowDamHeight_ThrowsCriticalFileReadException( string faultyFileName, string expectedReadText) { - string expectedMessage = string.Format("de ingelezen damhoogte ('{0}') is te groot of te klein om ingelezen te worden.", - expectedReadText); + string expectedMessage = $"de ingelezen damhoogte ('{expectedReadText}') is te groot of te klein om ingelezen te worden."; ReadFileAndExpectCriticalFileReadException("profiel001", faultyFileName, 7, expectedMessage); } @@ -535,8 +521,7 @@ public void ReadDikeProfileData_FileWithUnparsableDikeHeight_ThrowsCriticalFileReadException( string faultyFileName, string expectedReadText) { - string expectedMessage = string.Format("de ingelezen dijkhoogte ('{0}') is geen getal.", - expectedReadText); + string expectedMessage = $"de ingelezen dijkhoogte ('{expectedReadText}') is geen getal."; ReadFileAndExpectCriticalFileReadException("profiel001", faultyFileName, 12, expectedMessage); } @@ -546,8 +531,7 @@ public void ReadDikeProfileData_FileWithOverflowDikeHeight_ThrowsCriticalFileReadException( string faultyFileName, string expectedReadText) { - string expectedMessage = string.Format("de ingelezen dijkhoogte ('{0}') is te groot of te klein om ingelezen te worden.", - expectedReadText); + string expectedMessage = $"de ingelezen dijkhoogte ('{expectedReadText}') is te groot of te klein om ingelezen te worden."; ReadFileAndExpectCriticalFileReadException("profiel001", faultyFileName, 12, expectedMessage); } @@ -558,8 +542,7 @@ public void ReadDikeProfileData_FileWithUnparsableDikeCount_ThrowsCriticalFileReadException( string faultyFileName, string expectedReadText) { - string expectedMessage = string.Format("het aantal punten van de dijkgeometrie ('{0}') moet worden gespecificeerd door middel van een geheel getal.", - expectedReadText); + string expectedMessage = $"het aantal punten van de dijkgeometrie ('{expectedReadText}') moet worden gespecificeerd door middel van een geheel getal."; ReadFileAndExpectCriticalFileReadException("profiel004", faultyFileName, 16, expectedMessage); } @@ -569,8 +552,7 @@ public void ReadDikeProfileData_FileWithOverflowDijkCount_ThrowsCriticalFileReadException( string faultyFileName, string expectedReadText) { - string expectedMessage = string.Format("het gespecificeerde aantal punten van de dijkgeometrie ('{0}') is te groot of te klein om ingelezen te worden.", - expectedReadText); + string expectedMessage = $"het gespecificeerde aantal punten van de dijkgeometrie ('{expectedReadText}') is te groot of te klein om ingelezen te worden."; ReadFileAndExpectCriticalFileReadException("profiel004", faultyFileName, 16, expectedMessage); } @@ -591,8 +573,7 @@ public void ReadDikeProfileData_UnparsableRoughnessPoints_ThrowsCriticalFileReadException( string faultyFileName, int expectedLineNumber, string expectedParameterName, string expectedReadText) { - string expectedMessage = string.Format("de ingelezen {0} ('{1}') is geen getal.", - expectedParameterName, expectedReadText); + string expectedMessage = $"de ingelezen {expectedParameterName} ('{expectedReadText}') is geen getal."; ReadFileAndExpectCriticalFileReadException("profiel004", faultyFileName, expectedLineNumber, expectedMessage); } @@ -612,7 +593,7 @@ public void ReadDikeProfileData_NoRoughnessPointDefinition_ThrowsCriticalFileReadException( string faultyFileName, int expectedLineNumber, string expectedReadText) { - string expectedMessage = string.Format("de ingelezen regel ('{0}') is geen 'X Y ruwheid' definitie.", expectedReadText); + string expectedMessage = $"de ingelezen regel ('{expectedReadText}') is geen 'X Y ruwheid' definitie."; ReadFileAndExpectCriticalFileReadException("profiel004", faultyFileName, expectedLineNumber, expectedMessage); } @@ -632,8 +613,7 @@ public void ReadDikeProfileData_OverflowRoughnessPoints_ThrowsCriticalFileReadException( string faultyFileName, int expectedLineNumber, string expectedParameterName, string expectedReadText) { - string expectedMessage = string.Format("de in te lezen {0} ('{1}') is te groot of te klein om ingelezen te worden.", - expectedParameterName, expectedReadText); + string expectedMessage = $"de in te lezen {expectedParameterName} ('{expectedReadText}') is te groot of te klein om ingelezen te worden."; ReadFileAndExpectCriticalFileReadException("profiel004", faultyFileName, expectedLineNumber, expectedMessage); } @@ -644,8 +624,7 @@ public void ReadDikeProfileData_FileWithMissingDikePoints_ThrowsCriticalFileReadException( string faultyFileName, int expectedLineNumber, int actualCount, int expectedCount) { - string expectedMessage = string.Format("het aantal punten van de dijkgeometrie gevonden in het bestand '{0}' komt niet overeen met de daarin aangegeven hoeveelheid ('{1}').", - actualCount, expectedCount); + string expectedMessage = $"het aantal punten van de dijkgeometrie gevonden in het bestand '{actualCount}' komt niet overeen met de daarin aangegeven hoeveelheid ('{expectedCount}')."; ReadFileAndExpectCriticalFileReadException("profiel004", faultyFileName, expectedLineNumber, expectedMessage); } @@ -658,8 +637,7 @@ public void ReadDikeProfileData_IncorrectOrderingX_ThrowsCriticalFileReadException( string faultyFileName, int expectedLineNumber, string expectedTypePrefix) { - string expectedMessage = string.Format("de X-coördinaten van de {0}geometriepunten moeten strikt toenemend zijn.", - expectedTypePrefix); + string expectedMessage = $"de X-coördinaten van de {expectedTypePrefix}geometriepunten moeten strikt toenemend zijn."; ReadFileAndExpectCriticalFileReadException("profiel004", faultyFileName, expectedLineNumber, expectedMessage); } @@ -670,8 +648,7 @@ public void ReadDikeProfileData_FileWithUnparsableForeshoreCount_ThrowsCriticalFileReadException( string faultyFileName, string expectedReadText) { - string expectedMessage = string.Format("het aantal punten van de voorlandgeometrie ('{0}') moet worden gespecificeerd door middel van een geheel getal.", - expectedReadText); + string expectedMessage = $"het aantal punten van de voorlandgeometrie ('{expectedReadText}') moet worden gespecificeerd door middel van een geheel getal."; ReadFileAndExpectCriticalFileReadException("profiel004", faultyFileName, 9, expectedMessage); } @@ -681,8 +658,7 @@ public void ReadDikeProfileData_FileWithOverflowForeshoreCount_ThrowsCriticalFileReadException( string faultyFileName, string expectedReadText) { - string expectedMessage = string.Format("het gespecificeerde aantal punten van de voorlandgeometrie ('{0}') is te groot of te klein om ingelezen te worden.", - expectedReadText); + string expectedMessage = $"het gespecificeerde aantal punten van de voorlandgeometrie ('{expectedReadText}') is te groot of te klein om ingelezen te worden."; ReadFileAndExpectCriticalFileReadException("profiel004", faultyFileName, 9, expectedMessage); } @@ -715,8 +691,7 @@ public void ReadDikeProfileData_FileWithDoubleParameter_ThrowsCriticalFileReadException( string faultyFileName, int expectedLineNumber, string expectedKeyword) { - string expectedMessage = string.Format("de parameter {0} is al eerder in het bestand gedefinieerd.", - expectedKeyword); + string expectedMessage = $"de parameter {expectedKeyword} is al eerder in het bestand gedefinieerd."; ReadFileAndExpectCriticalFileReadException("profiel001", faultyFileName, expectedLineNumber, expectedMessage); } @@ -731,8 +706,7 @@ public void ReadDikeProfileData_FileWithUnexpectedText_ThrowsCriticalFileReadException( string faultyFileName, int expectedLineNumber, string expectedText) { - string expectedMessage = string.Format("de regel ('{0}') bevat ongeldige tekst.", - expectedText); + string expectedMessage = $"de regel ('{expectedText}') bevat ongeldige tekst."; ReadFileAndExpectCriticalFileReadException("profiel001", faultyFileName, expectedLineNumber, expectedMessage); } @@ -752,8 +726,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel {1}: {2}", - faultyFilePath, lineNumber, errorMessage); + string expectedMessage = $"Fout bij het lezen van bestand '{faultyFilePath}' op regel {lineNumber}: {errorMessage}"; Assert.AreEqual(expectedMessage, message); } @@ -773,8 +746,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': {1}", - faultyFilePath, errorMessage); + string expectedMessage = $"Fout bij het lezen van bestand '{faultyFilePath}': {errorMessage}"; Assert.AreEqual(expectedMessage, message); } Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/DikeProfiles/ProfileLocationReaderTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/DikeProfiles/ProfileLocationReaderTest.cs (.../ProfileLocationReaderTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/DikeProfiles/ProfileLocationReaderTest.cs (.../ProfileLocationReaderTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -59,8 +59,7 @@ TestDelegate call = () => new ProfileLocationReader(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet leeg of ongedefinieerd zijn.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': bestandspad mag niet leeg of ongedefinieerd zijn."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } @@ -94,8 +93,7 @@ TestDelegate call = () => new ProfileLocationReader(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet verwijzen naar een lege bestandsnaam.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': bestandspad mag niet verwijzen naar een lege bestandsnaam."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } @@ -110,8 +108,7 @@ TestDelegate call = () => new ProfileLocationReader(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestand bestaat niet.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': het bestand bestaat niet."; string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } @@ -133,8 +130,7 @@ TestDelegate call = () => new ProfileLocationReader(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': kon geen punten vinden in dit bestand.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': kon geen punten vinden in dit bestand."; string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } @@ -154,8 +150,7 @@ TestDelegate call = () => new ProfileLocationReader(invalidFilePath); // Assert - string expectedMessage = string.Format("Het bestand heeft geen attribuut '{0}'. Dit attribuut is vereist.", - missingColumnName); + string expectedMessage = $"Het bestand heeft geen attribuut '{missingColumnName}'. Dit attribuut is vereist."; string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/FailureMechanismSectionReaderTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/FailureMechanismSectionReaderTest.cs (.../FailureMechanismSectionReaderTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/FailureMechanismSectionReaderTest.cs (.../FailureMechanismSectionReaderTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -58,8 +58,7 @@ TestDelegate call = () => new FailureMechanismSectionReader(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet leeg of ongedefinieerd zijn.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': bestandspad mag niet leeg of ongedefinieerd zijn."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } @@ -93,8 +92,7 @@ TestDelegate call = () => new FailureMechanismSectionReader(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet verwijzen naar een lege bestandsnaam.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': bestandspad mag niet verwijzen naar een lege bestandsnaam."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } @@ -109,8 +107,7 @@ TestDelegate call = () => new FailureMechanismSectionReader(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestand bestaat niet.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': het bestand bestaat niet."; string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } @@ -131,8 +128,7 @@ TestDelegate call = () => new FailureMechanismSectionReader(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': kon geen lijnen vinden in dit bestand.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': kon geen lijnen vinden in dit bestand."; string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } @@ -170,9 +166,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format( - "Fout bij het lezen van bestand '{0}': het bestand heeft geen attribuut 'Vaknaam'. Dit attribuut is vereist.", - validFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{validFilePath}': het bestand heeft geen attribuut 'Vaknaam'. Dit attribuut is vereist."; Assert.AreEqual(expectedMessage, message); } } @@ -237,9 +231,8 @@ FailureMechanismSection section = reader.ReadFailureMechanismSection(); // Assert - string expectedSectionName = string.Format("1-1_{0}", i); - Assert.AreEqual(expectedSectionName, section.Name, - string.Format("Section name is not as expected at index {0}", i)); + string expectedSectionName = $"1-1_{i}"; + Assert.AreEqual(expectedSectionName, section.Name, $"Section name is not as expected at index {i}"); } } } @@ -283,9 +276,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format( - "Fout bij het lezen van bestand '{0}': het bestand heeft geen attribuut 'Vaknaam'. Dit attribuut is vereist.", - validFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{validFilePath}': het bestand heeft geen attribuut 'Vaknaam'. Dit attribuut is vereist."; Assert.AreEqual(expectedMessage, message); } } @@ -310,9 +301,8 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format( - "Fout bij het lezen van bestand '{0}': het bestand bevat één of meerdere multi-polylijnen. Multi-polylijnen worden niet ondersteund.", - validFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{validFilePath}': het bestand bevat één of meerdere multi-polylijnen. " + + "Multi-polylijnen worden niet ondersteund."; Assert.AreEqual(expectedMessage, message); } } Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/FailureMechanismSectionsImporterTest.cs =================================================================== diff -u -r31f4ca2b08257cf05459f63e0d715239e3d90c55 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/FailureMechanismSectionsImporterTest.cs (.../FailureMechanismSectionsImporterTest.cs) (revision 31f4ca2b08257cf05459f63e0d715239e3d90c55) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/FailureMechanismSectionsImporterTest.cs (.../FailureMechanismSectionsImporterTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -223,8 +223,8 @@ Action call = () => importSuccessful = importer.Import(); // Assert - string expectedMessage = string.Format(@"Fout bij het lezen van bestand '{0}': bestandspad mag niet verwijzen naar een lege bestandsnaam. ", sectionsFilePath) + Environment.NewLine + - "Er is geen vakindeling geïmporteerd."; + string expectedMessage = $@"Fout bij het lezen van bestand '{sectionsFilePath}': bestandspad mag niet verwijzen naar een lege bestandsnaam. " + + $"{Environment.NewLine}Er is geen vakindeling geïmporteerd."; TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1); Assert.IsFalse(importSuccessful); CollectionAssert.IsEmpty(failureMechanism.Sections); @@ -250,8 +250,8 @@ // Assert string expectedMessage = - string.Format(@"Fout bij het lezen van bestand '{0}': het bestand bestaat niet. ", sectionsFilePath) + Environment.NewLine + - "Er is geen vakindeling geïmporteerd."; + $@"Fout bij het lezen van bestand '{sectionsFilePath}': het bestand bestaat niet. " + + $"{Environment.NewLine}Er is geen vakindeling geïmporteerd."; TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1); Assert.IsFalse(importSuccessful); CollectionAssert.IsEmpty(failureMechanism.Sections); @@ -277,8 +277,8 @@ Action call = () => importSuccessful = importer.Import(); // Assert - string expectedMessage = "Het bestand heeft geen vakindeling. " + Environment.NewLine + - "Er is geen vakindeling geïmporteerd."; + string expectedMessage = "Het bestand heeft geen vakindeling. " + + $"{Environment.NewLine}Er is geen vakindeling geïmporteerd."; TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1); Assert.IsFalse(importSuccessful); CollectionAssert.IsEmpty(failureMechanism.Sections); @@ -292,7 +292,7 @@ // Setup string referenceLineFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, Path.Combine("ReferenceLine", "Artificial_referencelijn_testA.shp")); - string shapeFileName = string.Format("Artificial_referencelijn_testA_InvalidVakken_Section{0}.shp", shapeCondition); + string shapeFileName = $"Artificial_referencelijn_testA_InvalidVakken_Section{shapeCondition}.shp"; string sectionsFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, Path.Combine("FailureMechanismSections", shapeFileName)); @@ -307,8 +307,8 @@ Action call = () => importSuccessful = importer.Import(); // Assert - string expectedMessage = "De geografische ligging van ieder vak moet overeenkomen met de ligging van (een deel van) de referentielijn. " + Environment.NewLine + - "Er is geen vakindeling geïmporteerd."; + string expectedMessage = "De geografische ligging van ieder vak moet overeenkomen met de ligging van (een deel van) de referentielijn. " + + $"{Environment.NewLine}Er is geen vakindeling geïmporteerd."; TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1); Assert.IsFalse(importSuccessful); CollectionAssert.IsEmpty(failureMechanism.Sections); @@ -322,7 +322,7 @@ // Setup string referenceLineFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, Path.Combine("ReferenceLine", "Artificial_referencelijn_testA.shp")); - string shapeFileName = string.Format("Artificial_referencelijn_testA_InvalidVakken_{0}.shp", shapeCondition); + string shapeFileName = $"Artificial_referencelijn_testA_InvalidVakken_{shapeCondition}.shp"; string sectionsFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, Path.Combine("FailureMechanismSections", shapeFileName)); @@ -337,8 +337,8 @@ Action call = () => importSuccessful = importer.Import(); // Assert - string expectedMessage = "De geografische ligging van ieder vak moet overeenkomen met de ligging van (een deel van) de referentielijn. " + Environment.NewLine + - "Er is geen vakindeling geïmporteerd."; + string expectedMessage = "De geografische ligging van ieder vak moet overeenkomen met de ligging van (een deel van) de referentielijn. " + + $"{Environment.NewLine}Er is geen vakindeling geïmporteerd."; TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1); Assert.IsFalse(importSuccessful); CollectionAssert.IsEmpty(failureMechanism.Sections); @@ -364,8 +364,8 @@ Action call = () => importSuccessful = importer.Import(); // Assert - string expectedMessage = "De opgetelde lengte van de vakken moet overeenkomen met de trajectlengte. " + Environment.NewLine + - "Er is geen vakindeling geïmporteerd."; + string expectedMessage = "De opgetelde lengte van de vakken moet overeenkomen met de trajectlengte. " + + $"{Environment.NewLine}Er is geen vakindeling geïmporteerd."; TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1); Assert.IsFalse(importSuccessful); CollectionAssert.IsEmpty(failureMechanism.Sections); @@ -391,8 +391,8 @@ Action call = () => importSuccessful = importer.Import(); // Assert - string expectedMessage = "De opgetelde lengte van de vakken moet overeenkomen met de trajectlengte. " + Environment.NewLine + - "Er is geen vakindeling geïmporteerd."; + string expectedMessage = "De opgetelde lengte van de vakken moet overeenkomen met de trajectlengte. " + + $"{Environment.NewLine}Er is geen vakindeling geïmporteerd."; TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1); Assert.IsFalse(importSuccessful); CollectionAssert.IsEmpty(failureMechanism.Sections); @@ -414,10 +414,8 @@ Action call = () => importSuccessful = importer.Import(); // Assert - string expectedMessage = string.Format( - "Fout bij het lezen van bestand '{0}': voor één of meerdere vakken is geen naam opgegeven. {1}Er is geen vakindeling geïmporteerd.", - sectionsFilePath, - Environment.NewLine); + string expectedMessage = $"Fout bij het lezen van bestand '{sectionsFilePath}': voor één of meerdere vakken is geen naam opgegeven. " + + $"{Environment.NewLine}Er is geen vakindeling geïmporteerd."; TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1); Assert.IsFalse(importSuccessful); CollectionAssert.IsEmpty(failureMechanism.Sections); Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/HydraRing/HydraulicDatabaseHelperTest.cs =================================================================== diff -u -r3ed8e00da47ef2780e79688a9902e12b674e4cc0 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/HydraRing/HydraulicDatabaseHelperTest.cs (.../HydraulicDatabaseHelperTest.cs) (revision 3ed8e00da47ef2780e79688a9902e12b674e4cc0) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/HydraRing/HydraulicDatabaseHelperTest.cs (.../HydraulicDatabaseHelperTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -58,7 +58,7 @@ string result = HydraulicDatabaseHelper.ValidatePathForCalculation(filePath); // Assert - StringAssert.StartsWith(string.Format("Fout bij het lezen van bestand '{0}':", filePath), result); + StringAssert.StartsWith($"Fout bij het lezen van bestand '{filePath}':", result); } [Test] @@ -72,7 +72,7 @@ string result = HydraulicDatabaseHelper.ValidatePathForCalculation(invalidPath); // Assert - StringAssert.StartsWith(string.Format("Fout bij het lezen van bestand '{0}':", invalidPath), result); + StringAssert.StartsWith($"Fout bij het lezen van bestand '{invalidPath}':", result); } [Test] @@ -85,7 +85,7 @@ string result = HydraulicDatabaseHelper.ValidatePathForCalculation(filePath); // Assert - StringAssert.StartsWith(string.Format("Fout bij het lezen van bestand '{0}':", filePath), result); + StringAssert.StartsWith($"Fout bij het lezen van bestand '{filePath}':", result); } [Test] @@ -98,7 +98,7 @@ string result = HydraulicDatabaseHelper.ValidatePathForCalculation(validFilePath); // Assert - StringAssert.StartsWith(string.Format("Fout bij het lezen van bestand '{0}':", validFilePath), result); + StringAssert.StartsWith($"Fout bij het lezen van bestand '{validFilePath}':", result); } [Test] @@ -111,7 +111,7 @@ string result = HydraulicDatabaseHelper.ValidatePathForCalculation(validFilePath); // Assert - StringAssert.StartsWith(string.Format("Fout bij het lezen van bestand '{0}':", validFilePath), result); + StringAssert.StartsWith($"Fout bij het lezen van bestand '{validFilePath}':", result); } [Test] Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineImporterTest.cs =================================================================== diff -u -rd1bf253a0e3f11a168b4e185c4413c23995a1e8b -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineImporterTest.cs (.../ReferenceLineImporterTest.cs) (revision d1bf253a0e3f11a168b4e185c4413c23995a1e8b) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineImporterTest.cs (.../ReferenceLineImporterTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -122,11 +122,15 @@ { new ExpectedProgressNotification { - Text = "Inlezen referentielijn.", CurrentStep = 1, TotalNumberOfSteps = 2 + Text = "Inlezen referentielijn.", + CurrentStep = 1, + TotalNumberOfSteps = 2 }, new ExpectedProgressNotification { - Text = "Geïmporteerde data toevoegen aan het toetsspoor.", CurrentStep = 2, TotalNumberOfSteps = 2 + Text = "Geïmporteerde data toevoegen aan het toetsspoor.", + CurrentStep = 2, + TotalNumberOfSteps = 2 } }; var progressChangedCallCount = 0; @@ -170,8 +174,8 @@ Action call = () => importSuccessful = importer.Import(); // Assert - string expectedMessage = string.Format(@"Fout bij het lezen van bestand '{0}': bestandspad mag niet verwijzen naar een lege bestandsnaam. ", path) + Environment.NewLine + - "Er is geen referentielijn geïmporteerd."; + string expectedMessage = $@"Fout bij het lezen van bestand '{path}': bestandspad mag niet verwijzen naar een lege bestandsnaam. " + + $"{Environment.NewLine}Er is geen referentielijn geïmporteerd."; TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1); Assert.IsFalse(importSuccessful); mocks.VerifyAll(); @@ -200,8 +204,8 @@ Action call = () => importSuccessful = importer.Import(); // Assert - string expectedMessage = string.Format(@"Fout bij het lezen van bestand '{0}': het bestand bestaat niet. ", path) + Environment.NewLine + - "Er is geen referentielijn geïmporteerd."; + string expectedMessage = $@"Fout bij het lezen van bestand '{path}': het bestand bestaat niet. " + + $"{Environment.NewLine}Er is geen referentielijn geïmporteerd."; TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1); Assert.IsFalse(importSuccessful); mocks.VerifyAll(); Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineMetaImporterTest.cs =================================================================== diff -u -r4840075b1266d759456ee0bc4a0d561e428cf5f1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineMetaImporterTest.cs (.../ReferenceLineMetaImporterTest.cs) (revision 4840075b1266d759456ee0bc4a0d561e428cf5f1) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineMetaImporterTest.cs (.../ReferenceLineMetaImporterTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -49,8 +49,7 @@ TestDelegate call = () => new ReferenceLineMetaImporter(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet leeg of ongedefinieerd zijn.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': bestandspad mag niet leeg of ongedefinieerd zijn."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } @@ -83,8 +82,7 @@ TestDelegate call = () => new ReferenceLineMetaImporter(pathTooLong); // Assert - string expectedExceptionMessage = string.Format("De map met specificaties voor trajecten '{0}' is niet gevonden.", - pathTooLong); + string expectedExceptionMessage = $"De map met specificaties voor trajecten '{pathTooLong}' is niet gevonden."; var exception = Assert.Throws(call); Assert.AreEqual(expectedExceptionMessage, exception.Message); } @@ -102,8 +100,7 @@ TestDelegate call = () => new ReferenceLineMetaImporter(pathToNonExistingFolder); // Assert - string expectedExceptionMessage = string.Format("De map met specificaties voor trajecten '{0}' is niet gevonden.", - pathToNonExistingFolder); + string expectedExceptionMessage = $"De map met specificaties voor trajecten '{pathToNonExistingFolder}' is niet gevonden."; var exception = Assert.Throws(call); Assert.AreEqual(expectedExceptionMessage, exception.Message); } @@ -118,8 +115,7 @@ TestDelegate call = () => new ReferenceLineMetaImporter(pathToEmptyFolder); // Assert - string expectedExceptionMessage = string.Format(@"Geen shapebestand om trajecten te specificeren gevonden in de map '{0}'.", - pathToEmptyFolder); + string expectedExceptionMessage = $@"Geen shapebestand om trajecten te specificeren gevonden in de map '{pathToEmptyFolder}'."; var exception = Assert.Throws(call); Assert.AreEqual(expectedExceptionMessage, exception.Message); } @@ -134,7 +130,7 @@ Action call = () => new ReferenceLineMetaImporter(pathToFolder); // Assert - string expectedMessage = string.Format(@"Meerdere shapebestanden gevonden in '{0}'. Het bestand 'NBPW_A.shp' is gebruikt.", pathToFolder); + string expectedMessage = $@"Meerdere shapebestanden gevonden in '{pathToFolder}'. Het bestand 'NBPW_A.shp' is gebruikt."; TestHelper.AssertLogMessageIsGenerated(call, expectedMessage); } @@ -149,8 +145,9 @@ TestDelegate call = () => importer.GetReferenceLineMetas(); // Assert - string expectedExceptionMessage = string.Format("Het shapebestand '{0}' om trajecten te specificeren moet de attributen 'TRAJECT_ID', 'NORM_SW', en 'NORM_OG' bevatten: {1} niet gevonden.", - Path.Combine(pathToInvalid, "InvalidShapeFile.shp"), "'TRAJECT_ID', 'NORM_SW', 'NORM_OG'"); + string expectedExceptionMessage = $"Het shapebestand '{Path.Combine(pathToInvalid, "InvalidShapeFile.shp")}' " + + "om trajecten te specificeren moet de attributen 'TRAJECT_ID', 'NORM_SW', en 'NORM_OG' bevatten: " + + @"'TRAJECT_ID', 'NORM_SW', 'NORM_OG' niet gevonden."; var exception = Assert.Throws(call); Assert.AreEqual(expectedExceptionMessage, exception.Message); } @@ -167,8 +164,8 @@ // Assert string shapeFile = Path.Combine(pathToFolder, "NonUniqueTrajectIds.shp"); - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': meerdere trajecten met dezelfde identificatiecode (attribuut 'TRAJECT_ID') gevonden.", - shapeFile); + string expectedMessage = $"Fout bij het lezen van bestand '{shapeFile}': meerdere trajecten met dezelfde identificatiecode " + + "(attribuut 'TRAJECT_ID') gevonden."; var exception = Assert.Throws(call); Assert.AreEqual(expectedMessage, exception.Message); } @@ -185,7 +182,8 @@ // Assert string shapeFile = Path.Combine(pathToFolder, "EmptyTrackId.shp"); - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': trajecten gevonden zonder een geldige identificatiecode (attribuut 'TRAJECT_ID').", shapeFile); + string expectedMessage = $"Fout bij het lezen van bestand '{shapeFile}': trajecten gevonden zonder een geldige " + + "identificatiecode (attribuut 'TRAJECT_ID')."; var exception = Assert.Throws(call); Assert.AreEqual(expectedMessage, exception.Message); } @@ -267,7 +265,7 @@ Point2D[] actualPoints = actualReferenceLineMeta.ReferenceLine.Points.ToArray(); CollectionAssert.AreEqual(expectedPoints, actualPoints, new Point2DComparerWithTolerance(1e-6), - string.Format("Unexpected geometry found in ReferenceLineMeta with id '{0}'", actualReferenceLineMeta.AssessmentSectionId)); + $"Unexpected geometry found in ReferenceLineMeta with id '{actualReferenceLineMeta.AssessmentSectionId}'"); } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineReaderTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineReaderTest.cs (.../ReferenceLineReaderTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineReaderTest.cs (.../ReferenceLineReaderTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -67,8 +67,7 @@ TestDelegate call = () => reader.ReadReferenceLine(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet leeg of ongedefinieerd zijn.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': bestandspad mag niet leeg of ongedefinieerd zijn."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } @@ -106,8 +105,7 @@ TestDelegate call = () => reader.ReadReferenceLine(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet verwijzen naar een lege bestandsnaam.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': bestandspad mag niet verwijzen naar een lege bestandsnaam."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } @@ -124,8 +122,7 @@ TestDelegate call = () => reader.ReadReferenceLine(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestand bestaat niet.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': het bestand bestaat niet."; string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } @@ -148,8 +145,7 @@ TestDelegate call = () => reader.ReadReferenceLine(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': kon geen lijnen vinden in dit bestand.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': kon geen lijnen vinden in dit bestand."; string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } @@ -169,8 +165,7 @@ TestDelegate call = () => reader.ReadReferenceLine(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestand moet exact één gehele polylijn bevatten.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': het bestand moet exact één gehele polylijn bevatten."; string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } @@ -188,8 +183,8 @@ TestDelegate call = () => reader.ReadReferenceLine(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestand bevat een multi-polylijn. Multi-polylijnen worden niet ondersteund.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': het bestand bevat een multi-polylijn. " + + "Multi-polylijnen worden niet ondersteund."; string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLinesMetaReaderTest.cs =================================================================== diff -u -r4840075b1266d759456ee0bc4a0d561e428cf5f1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLinesMetaReaderTest.cs (.../ReferenceLinesMetaReaderTest.cs) (revision 4840075b1266d759456ee0bc4a0d561e428cf5f1) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLinesMetaReaderTest.cs (.../ReferenceLinesMetaReaderTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -48,8 +48,7 @@ TestDelegate call = () => ReferenceLinesMetaReader.ReadReferenceLinesMetas(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet leeg of ongedefinieerd zijn.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': bestandspad mag niet leeg of ongedefinieerd zijn."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } @@ -81,8 +80,7 @@ TestDelegate call = () => ReferenceLinesMetaReader.ReadReferenceLinesMetas(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet verwijzen naar een lege bestandsnaam.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': bestandspad mag niet verwijzen naar een lege bestandsnaam."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } @@ -96,8 +94,7 @@ TestDelegate call = () => ReferenceLinesMetaReader.ReadReferenceLinesMetas(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestand bestaat niet.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': het bestand bestaat niet."; string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } @@ -116,8 +113,7 @@ TestDelegate call = () => ReferenceLinesMetaReader.ReadReferenceLinesMetas(invalidFilePath); // Assert . - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': kon geen lijnen vinden in dit bestand.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': kon geen lijnen vinden in dit bestand."; string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } @@ -151,8 +147,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Het shapebestand '{0}' om trajecten te specificeren moet de attributen 'TRAJECT_ID', 'NORM_SW', en 'NORM_OG' bevatten: '{1}' niet gevonden.", validFilePath, - missingAttribute); + string expectedMessage = $"Het shapebestand '{validFilePath}' om trajecten te specificeren moet de attributen 'TRAJECT_ID', 'NORM_SW', en 'NORM_OG' bevatten: '{missingAttribute}' niet gevonden."; Assert.AreEqual(expectedMessage, message); } @@ -170,8 +165,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Het shapebestand '{0}' om trajecten te specificeren moet de attributen 'TRAJECT_ID', 'NORM_SW', en 'NORM_OG' bevatten: '{1}' niet gevonden.", validFilePath, - missingAttributes); + string expectedMessage = $"Het shapebestand '{validFilePath}' om trajecten te specificeren moet de attributen 'TRAJECT_ID', 'NORM_SW', en 'NORM_OG' bevatten: '{missingAttributes}' niet gevonden."; Assert.AreEqual(expectedMessage, message); } @@ -270,7 +264,7 @@ Point2D[] actualPoints = actualReferenceLineMeta.ReferenceLine.Points.ToArray(); CollectionAssert.AreEqual(expectedPoints, actualPoints, new Point2DComparerWithTolerance(1e-6), - string.Format("Unexpected geometry found in ReferenceLineMeta with id '{0}'", actualReferenceLineMeta.AssessmentSectionId)); + $"Unexpected geometry found in ReferenceLineMeta with id '{actualReferenceLineMeta.AssessmentSectionId}'"); } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/DistributionHelperTest.cs =================================================================== diff -u -r604dfe021f6161f8e5d107dd5821ba06390c5ecf -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/DistributionHelperTest.cs (.../DistributionHelperTest.cs) (revision 604dfe021f6161f8e5d107dd5821ba06390c5ecf) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/DistributionHelperTest.cs (.../DistributionHelperTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -39,8 +39,8 @@ // Call TestDelegate call = () => DistributionHelper.ValidateIsNonShiftedLogNormal(distributionType, - shift, - null); + shift, + null); // Assert var exception = Assert.Throws(call); @@ -59,8 +59,8 @@ // Call TestDelegate call = () => DistributionHelper.ValidateIsNonShiftedLogNormal(distributionType, - shift, - parameterName); + shift, + parameterName); // Assert var exception = Assert.Throws(call); @@ -76,8 +76,8 @@ // Call TestDelegate call = () => DistributionHelper.ValidateIsNonShiftedLogNormal(distributionType, - shift, - string.Empty); + shift, + string.Empty); // Assert Assert.DoesNotThrow(call); @@ -93,8 +93,8 @@ // Call TestDelegate call = () => DistributionHelper.ValidateIsNonShiftedLogNormal(null, - shift, - parameterName); + shift, + parameterName); // Assert Assert.DoesNotThrow(call); @@ -109,7 +109,7 @@ // Call TestDelegate call = () => DistributionHelper.ValidateIsLogNormal(distributionType, - null); + null); // Assert var exception = Assert.Throws(call); @@ -125,7 +125,7 @@ // Call TestDelegate call = () => DistributionHelper.ValidateIsLogNormal(invalidDistributionType, - parameterName); + parameterName); // Assert var exception = Assert.Throws(call); @@ -140,7 +140,7 @@ // Call TestDelegate call = () => DistributionHelper.ValidateIsLogNormal(distributionType, - string.Empty); + string.Empty); // Assert Assert.DoesNotThrow(call); @@ -154,7 +154,7 @@ // Call TestDelegate call = () => DistributionHelper.ValidateIsLogNormal(null, - parameterName); + parameterName); // Assert Assert.DoesNotThrow(call); Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructureLocationReaderTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructureLocationReaderTest.cs (.../StructureLocationReaderTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructureLocationReaderTest.cs (.../StructureLocationReaderTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -59,8 +59,7 @@ TestDelegate call = () => new StructureLocationReader(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet leeg of ongedefinieerd zijn.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': bestandspad mag niet leeg of ongedefinieerd zijn."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } @@ -94,8 +93,7 @@ TestDelegate call = () => new StructureLocationReader(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet verwijzen naar een lege bestandsnaam.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': bestandspad mag niet verwijzen naar een lege bestandsnaam."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } @@ -109,8 +107,7 @@ TestDelegate call = () => new StructureLocationReader(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestand bestaat niet.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': het bestand bestaat niet."; string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } @@ -131,8 +128,7 @@ TestDelegate call = () => new StructureLocationReader(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': kon geen punten vinden in dit bestand.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': kon geen punten vinden in dit bestand."; string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } @@ -148,8 +144,7 @@ TestDelegate call = () => new StructureLocationReader(invalidFilePath); // Assert - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestand heeft geen attribuut '{1}'. Dit attribuut is vereist.", - invalidFilePath, "KWKIDENT"); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': het bestand heeft geen attribuut '{"KWKIDENT"}'. Dit attribuut is vereist."; string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructuresCharacteristicsCsvReaderTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructuresCharacteristicsCsvReaderTest.cs (.../StructuresCharacteristicsCsvReaderTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructuresCharacteristicsCsvReaderTest.cs (.../StructuresCharacteristicsCsvReaderTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -34,7 +34,7 @@ [TestFixture] public class StructuresCharacteristicsCsvReaderTest { - private readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HeightStructures.IO, string.Format("Characteristics{0}", Path.DirectorySeparatorChar)); + private readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HeightStructures.IO, $"Characteristics{Path.DirectorySeparatorChar}"); [Test] [TestCase("")] @@ -111,8 +111,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestandspad verwijst naar een map die niet bestaat.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': het bestandspad verwijst naar een map die niet bestaat."; Assert.AreEqual(expectedMessage, message); } } @@ -131,8 +130,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 1: het bestand is leeg.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 1: het bestand is leeg."; Assert.AreEqual(expectedMessage, message); } } @@ -256,8 +254,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 1: de kolom '{1}' mag maar één keer gedefinieerd zijn.", - filePath, columnName); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 1: de kolom '{columnName}' mag maar één keer gedefinieerd zijn."; Assert.AreEqual(expectedMessage, message); } } @@ -292,8 +289,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestandspad verwijst naar een map die niet bestaat.", - invalidFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': het bestandspad verwijst naar een map die niet bestaat."; Assert.AreEqual(expectedMessage, message); } } @@ -312,8 +308,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 1: het bestand is leeg.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 1: het bestand is leeg."; Assert.AreEqual(expectedMessage, message); } } @@ -380,8 +375,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 1: de kolom '{1}' mag maar één keer gedefinieerd zijn.", - filePath, columnName); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 1: de kolom '{columnName}' mag maar één keer gedefinieerd zijn."; Assert.AreEqual(expectedMessage, message); } } @@ -417,8 +411,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 2: ontbrekend scheidingsteken ';'.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 2: ontbrekend scheidingsteken ';'."; Assert.AreEqual(expectedMessage, message); } } @@ -437,8 +430,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 2: regel verwacht 21 elementen, maar het zijn er 20.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 2: regel verwacht 21 elementen, maar het zijn er 20."; Assert.AreEqual(expectedMessage, message); } } @@ -457,8 +449,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 2: regel verwacht 21 elementen, maar het zijn er 23.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 2: regel verwacht 21 elementen, maar het zijn er 23."; Assert.AreEqual(expectedMessage, message); } } @@ -469,8 +460,7 @@ public void ReadLine_LineWithNoValueForLocationId_ThrowsLineParseException(string fileNamePostFix) { // Setup - string fileName = string.Format("InvalidFile_1Location_SecondLineLocationIdEmpty{0}.csv", - fileNamePostFix); + string fileName = $"InvalidFile_1Location_SecondLineLocationIdEmpty{fileNamePostFix}.csv"; string filePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, Path.Combine("Structures", "StructuresCharacteristicsCsvFiles", fileName)); @@ -481,8 +471,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 2: 'Identificatie' mag niet leeg zijn.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 2: 'Identificatie' mag niet leeg zijn."; Assert.AreEqual(expectedMessage, message); } } @@ -493,8 +482,7 @@ public void ReadLine_LineWithNoValueForParameterId_ThrowsLineParseException(string fileNamePostFix) { // Setup - string fileName = string.Format("InvalidFile_1Location_SecondLineParameterIdEmpty{0}.csv", - fileNamePostFix); + string fileName = $"InvalidFile_1Location_SecondLineParameterIdEmpty{fileNamePostFix}.csv"; string filePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, Path.Combine("Structures", "StructuresCharacteristicsCsvFiles", fileName)); @@ -505,8 +493,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 2: 'Kunstwerken.identificatie' mag niet leeg zijn.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 2: 'Kunstwerken.identificatie' mag niet leeg zijn."; Assert.AreEqual(expectedMessage, message); } } @@ -525,8 +512,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 2: de waarde voor 'Numeriekewaarde' kan niet worden omgezet naar een getal.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 2: de waarde voor 'Numeriekewaarde' kan niet worden omgezet naar een getal."; Assert.AreEqual(expectedMessage, message); } } @@ -545,8 +531,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 2: de waarde voor 'Numeriekewaarde' is te groot of te klein om ingelezen te worden.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 2: de waarde voor 'Numeriekewaarde' is te groot of te klein om ingelezen te worden."; Assert.AreEqual(expectedMessage, message); } } @@ -565,8 +550,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 2: de waarde voor 'Numeriekewaarde' is te groot of te klein om ingelezen te worden.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 2: de waarde voor 'Numeriekewaarde' is te groot of te klein om ingelezen te worden."; Assert.AreEqual(expectedMessage, message); } } @@ -585,8 +569,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 2: de waarde voor 'Standaardafwijking.variatie' kan niet worden omgezet naar een getal.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 2: de waarde voor 'Standaardafwijking.variatie' kan niet worden omgezet naar een getal."; Assert.AreEqual(expectedMessage, message); } } @@ -605,8 +588,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 2: de waarde voor 'Standaardafwijking.variatie' is te groot of te klein om ingelezen te worden.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 2: de waarde voor 'Standaardafwijking.variatie' is te groot of te klein om ingelezen te worden."; Assert.AreEqual(expectedMessage, message); } } @@ -625,8 +607,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 2: de waarde voor 'Standaardafwijking.variatie' is te groot of te klein om ingelezen te worden.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 2: de waarde voor 'Standaardafwijking.variatie' is te groot of te klein om ingelezen te worden."; Assert.AreEqual(expectedMessage, message); } } @@ -645,8 +626,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 2: de waarde voor 'Boolean' moet '0', '1' of leeg zijn.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 2: de waarde voor 'Boolean' moet '0', '1' of leeg zijn."; Assert.AreEqual(expectedMessage, message); } } @@ -665,8 +645,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 2: de waarde voor 'Boolean' moet '0', '1' of leeg zijn.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 2: de waarde voor 'Boolean' moet '0', '1' of leeg zijn."; Assert.AreEqual(expectedMessage, message); } } @@ -685,8 +664,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 2: de waarde voor 'Boolean' moet '0', '1' of leeg zijn.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 2: de waarde voor 'Boolean' moet '0', '1' of leeg zijn."; Assert.AreEqual(expectedMessage, message); } } @@ -705,8 +683,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 2: de waarde voor 'Boolean' moet '0', '1' of leeg zijn.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 2: de waarde voor 'Boolean' moet '0', '1' of leeg zijn."; Assert.AreEqual(expectedMessage, message); } } @@ -725,8 +702,7 @@ // Assert string message = Assert.Throws(call).Message; - string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}' op regel 2: de waarde voor 'Boolean' moet '0', '1' of leeg zijn.", - filePath); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}' op regel 2: de waarde voor 'Boolean' moet '0', '1' of leeg zijn."; Assert.AreEqual(expectedMessage, message); } } Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/SurfaceLines/CharacteristicPointsCsvReaderTest.cs =================================================================== diff -u -rc83f15fb42be282b6eb9fb3ff316c53bd3367be3 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/SurfaceLines/CharacteristicPointsCsvReaderTest.cs (.../CharacteristicPointsCsvReaderTest.cs) (revision c83f15fb42be282b6eb9fb3ff316c53bd3367be3) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/SurfaceLines/CharacteristicPointsCsvReaderTest.cs (.../CharacteristicPointsCsvReaderTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -449,7 +449,7 @@ public void ReadCharacteristicPointsLocation_FileHasCoordinateCausingOverOrUnderflow_ThrowsLineParseException(string malformattedVariableName) { // Setup - string path = Path.Combine(testDataPath, string.Format("1location_{0}.krp.csv", malformattedVariableName)); + string path = Path.Combine(testDataPath, $"1location_{malformattedVariableName}.krp.csv"); // Precondition Assert.IsTrue(File.Exists(path)); Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/SurfaceLines/SurfaceLinesCsvImporterTest.cs =================================================================== diff -u -r4d079c086f5fd38a3989f03fe79e3c95b842bcf6 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/SurfaceLines/SurfaceLinesCsvImporterTest.cs (.../SurfaceLinesCsvImporterTest.cs) (revision 4d079c086f5fd38a3989f03fe79e3c95b842bcf6) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/SurfaceLines/SurfaceLinesCsvImporterTest.cs (.../SurfaceLinesCsvImporterTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -1618,11 +1618,13 @@ string twovalidsurfacelinesCsv = string.Format(surfaceLineFormat, fileName); string validSurfaceLinesFilePath = Path.Combine(ioTestDataPath, twovalidsurfacelinesCsv); - var updateStrategy = new TestSurfaceLineUpdateStrategy(); - updateStrategy.UpdatedInstances = new[] + var updateStrategy = new TestSurfaceLineUpdateStrategy { - observableA, - observableB + UpdatedInstances = new[] + { + observableA, + observableB + } }; var importer = new SurfaceLinesCsvImporter( new TestSurfaceLineCollection(), Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/SurfaceLines/SurfaceLinesCsvReaderTest.cs =================================================================== diff -u -r7a17dea90cca0b0c670f1dfc2849a223b7014d59 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/SurfaceLines/SurfaceLinesCsvReaderTest.cs (.../SurfaceLinesCsvReaderTest.cs) (revision 7a17dea90cca0b0c670f1dfc2849a223b7014d59) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/SurfaceLines/SurfaceLinesCsvReaderTest.cs (.../SurfaceLinesCsvReaderTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -239,7 +239,7 @@ public void GetSurfaceLinesCount_InvalidHeader2_ThrowCriticalFileReadException(string missingVariableName) { // Setup - string filename = string.Format("InvalidHeader_Lacks{0}1.csv", missingVariableName); + string filename = $"InvalidHeader_Lacks{missingVariableName}1.csv"; string path = Path.Combine(testDataPath, filename); // Precondition @@ -521,7 +521,7 @@ public void ReadLine_InvalidHeader2_ThrowCriticalFileReadException(string missingVariableName) { // Setup - string filename = string.Format("InvalidHeader_Lacks{0}1.csv", missingVariableName); + string filename = $"InvalidHeader_Lacks{missingVariableName}1.csv"; string path = Path.Combine(testDataPath, filename); // Precondition @@ -548,7 +548,7 @@ public void ReadLine_FileHasInvalidCoordinate_ThrowLineParseException(string malformattedVariableName) { // Setup - string path = Path.Combine(testDataPath, string.Format("InvalidRow_{0}NotAValidNumber.csv", malformattedVariableName)); + string path = Path.Combine(testDataPath, $"InvalidRow_{malformattedVariableName}NotAValidNumber.csv"); // Precondition Assert.IsTrue(File.Exists(path)); @@ -579,7 +579,7 @@ public void ReadLine_FileHasCoordinateCausingOverOrUnderflow_ThrowLineParseException(string malformattedVariableName) { // Setup - string path = Path.Combine(testDataPath, string.Format("InvalidRow_{0}flowingNumber.csv", malformattedVariableName)); + string path = Path.Combine(testDataPath, $"InvalidRow_{malformattedVariableName}flowingNumber.csv"); // Precondition Assert.IsTrue(File.Exists(path)); Index: Ringtoets/Common/test/Ringtoets.Common.IO.TestUtil/CustomCalculationConfigurationExporterDesignGuidelinesTestFixture.cs =================================================================== diff -u -r681fe6f5c04ea2acdb99801dd749a11a174d5b42 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.IO.TestUtil/CustomCalculationConfigurationExporterDesignGuidelinesTestFixture.cs (.../CustomCalculationConfigurationExporterDesignGuidelinesTestFixture.cs) (revision 681fe6f5c04ea2acdb99801dd749a11a174d5b42) +++ Ringtoets/Common/test/Ringtoets.Common.IO.TestUtil/CustomCalculationConfigurationExporterDesignGuidelinesTestFixture.cs (.../CustomCalculationConfigurationExporterDesignGuidelinesTestFixture.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -34,7 +34,8 @@ namespace Ringtoets.Common.IO.TestUtil { [TestFixture] - public abstract class CustomCalculationConfigurationExporterDesignGuidelinesTestFixture< + public abstract class CustomCalculationConfigurationExporterDesignGuidelinesTestFixture + < TCalculationConfigurationExporter, TWriter, TCalculation, TConfiguration> where TCalculation : class, ICalculation where TWriter : CalculationConfigurationWriter Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/ParameterNameExtractorTest.cs =================================================================== diff -u -r081badaad87a6e2a6d5c861de9ee95fa1ca6dea3 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/ParameterNameExtractorTest.cs (.../ParameterNameExtractorTest.cs) (revision 081badaad87a6e2a6d5c861de9ee95fa1ca6dea3) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/ParameterNameExtractorTest.cs (.../ParameterNameExtractorTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -54,7 +54,7 @@ { // Setup const string parameterName = " A "; - string parameterWithUnits = string.Format("{0} [m/s]", parameterName); + string parameterWithUnits = $"{parameterName} [m/s]"; // Call string result = ParameterNameExtractor.GetFromDisplayName(parameterWithUnits); Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/RingtoetsCommonDataSynchronizationServiceTest.cs =================================================================== diff -u -r71d8173532c9c038e25caf03e296beb8e8f9cbe8 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/RingtoetsCommonDataSynchronizationServiceTest.cs (.../RingtoetsCommonDataSynchronizationServiceTest.cs) (revision 71d8173532c9c038e25caf03e296beb8e8f9cbe8) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/RingtoetsCommonDataSynchronizationServiceTest.cs (.../RingtoetsCommonDataSynchronizationServiceTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -30,7 +30,6 @@ using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Hydraulics; -using Ringtoets.Common.Data.Probability; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.Data.TestUtil; Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/ValidationRules/LogNormalDistributionRuleTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/ValidationRules/LogNormalDistributionRuleTest.cs (.../LogNormalDistributionRuleTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/ValidationRules/LogNormalDistributionRuleTest.cs (.../LogNormalDistributionRuleTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -66,7 +66,7 @@ // Assert Assert.AreEqual(1, validationMessages.Length); - string expectedMessage = string.Format("De verwachtingswaarde voor '{0}' moet een positief getal zijn.", paramName); + string expectedMessage = $"De verwachtingswaarde voor '{paramName}' moet een positief getal zijn."; StringAssert.StartsWith(expectedMessage, validationMessages[0]); } @@ -90,7 +90,7 @@ // Assert Assert.AreEqual(1, validationMessages.Length); - string expectedMessage = string.Format("De standaardafwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", paramName); + string expectedMessage = $"De standaardafwijking voor '{paramName}' moet groter zijn dan of gelijk zijn aan 0."; StringAssert.StartsWith(expectedMessage, validationMessages[0]); } } Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/ValidationRules/NormalDistributionRuleTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/ValidationRules/NormalDistributionRuleTest.cs (.../NormalDistributionRuleTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/ValidationRules/NormalDistributionRuleTest.cs (.../NormalDistributionRuleTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -67,7 +67,7 @@ // Assert Assert.AreEqual(1, validationMessages.Length); - string expectedMessage = string.Format("De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", paramName); + string expectedMessage = $"De verwachtingswaarde voor '{paramName}' moet een concreet getal zijn."; StringAssert.StartsWith(expectedMessage, validationMessages[0]); } @@ -91,7 +91,7 @@ // Assert Assert.AreEqual(1, validationMessages.Length); - string expectedMessage = string.Format("De standaardafwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", paramName); + string expectedMessage = $"De standaardafwijking voor '{paramName}' moet groter zijn dan of gelijk zijn aan 0."; StringAssert.StartsWith(expectedMessage, validationMessages[0]); } } Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/ValidationRules/NumericInputRuleTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/ValidationRules/NumericInputRuleTest.cs (.../NumericInputRuleTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/ValidationRules/NumericInputRuleTest.cs (.../NumericInputRuleTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -60,7 +60,7 @@ // Assert Assert.AreEqual(1, validationMessages.Length); - string expectedMessage = string.Format("De waarde voor '{0}' moet een concreet getal zijn.", paramName); + string expectedMessage = $"De waarde voor '{paramName}' moet een concreet getal zijn."; StringAssert.StartsWith(expectedMessage, validationMessages[0]); } } Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/ValidationRules/VariationCoefficientLogNormalDistributionRuleTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/ValidationRules/VariationCoefficientLogNormalDistributionRuleTest.cs (.../VariationCoefficientLogNormalDistributionRuleTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/ValidationRules/VariationCoefficientLogNormalDistributionRuleTest.cs (.../VariationCoefficientLogNormalDistributionRuleTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -67,7 +67,7 @@ // Assert Assert.AreEqual(1, validationMessages.Length); - string expectedMessage = string.Format("De verwachtingswaarde voor '{0}' moet een positief getal zijn.", paramName); + string expectedMessage = $"De verwachtingswaarde voor '{paramName}' moet een positief getal zijn."; StringAssert.StartsWith(expectedMessage, validationMessages[0]); } @@ -91,7 +91,7 @@ // Assert Assert.AreEqual(1, validationMessages.Length); - string expectedMessage = string.Format("De variatiecoëfficiënt voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", paramName); + string expectedMessage = $"De variatiecoëfficiënt voor '{paramName}' moet groter zijn dan of gelijk zijn aan 0."; StringAssert.StartsWith(expectedMessage, validationMessages[0]); } } Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/ValidationRules/VariationCoefficientNormalDistributionRuleTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/ValidationRules/VariationCoefficientNormalDistributionRuleTest.cs (.../VariationCoefficientNormalDistributionRuleTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/ValidationRules/VariationCoefficientNormalDistributionRuleTest.cs (.../VariationCoefficientNormalDistributionRuleTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -68,7 +68,7 @@ // Assert Assert.AreEqual(1, validationMessages.Length); - string expectedMessage = string.Format("De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", paramName); + string expectedMessage = $"De verwachtingswaarde voor '{paramName}' moet een concreet getal zijn."; StringAssert.StartsWith(expectedMessage, validationMessages[0]); } @@ -92,7 +92,7 @@ // Assert Assert.AreEqual(1, validationMessages.Length); - string expectedMessage = string.Format("De variatiecoëfficiënt voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", paramName); + string expectedMessage = $"De variatiecoëfficiënt voor '{paramName}' moet groter zijn dan of gelijk zijn aan 0."; StringAssert.StartsWith(expectedMessage, validationMessages[0]); } } Index: Ringtoets/Common/test/Ringtoets.Common.Service.TestUtil/Properties/AssemblyInfo.cs =================================================================== diff -u -r6b961e8d054ce4419f2bf370a4f03b778fc2cb23 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Service.TestUtil/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision 6b961e8d054ce4419f2bf370a4f03b778fc2cb23) +++ Ringtoets/Common/test/Ringtoets.Common.Service.TestUtil/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -24,4 +24,4 @@ [assembly: AssemblyTitle("Ringtoets.Common.Service.TestUtil")] [assembly: AssemblyProduct("Ringtoets.Common.Service.TestUtil")] -[assembly: Guid("52093da6-d545-476a-adfd-12f56625e36b")] +[assembly: Guid("52093da6-d545-476a-adfd-12f56625e36b")] \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Utils.Test/AssignUnassignCalculationsTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Utils.Test/AssignUnassignCalculationsTest.cs (.../AssignUnassignCalculationsTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.Utils.Test/AssignUnassignCalculationsTest.cs (.../AssignUnassignCalculationsTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -151,7 +151,8 @@ var section = new FailureMechanismSection("firstSection", new List { - new Point2D(0.0, 0.0), new Point2D(1.1, 1.1) + new Point2D(0.0, 0.0), + new Point2D(1.1, 1.1) }); var sectionResult = new FailureMechanismSectionResultWithCalculation(section); @@ -184,7 +185,8 @@ var sectionA = new FailureMechanismSection("firstSection", new List { - new Point2D(0.0, 0.0), new Point2D(1.1, 1.1) + new Point2D(0.0, 0.0), + new Point2D(1.1, 1.1) }); var sectionResult = new FailureMechanismSectionResultWithCalculation(sectionA); Index: Ringtoets/Common/test/Ringtoets.Common.Utils.Test/SectionResultWithCalculationAssignmentTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 --- Ringtoets/Common/test/Ringtoets.Common.Utils.Test/SectionResultWithCalculationAssignmentTest.cs (.../SectionResultWithCalculationAssignmentTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.Utils.Test/SectionResultWithCalculationAssignmentTest.cs (.../SectionResultWithCalculationAssignmentTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) @@ -33,7 +33,7 @@ public void Constructor_FailureMechanismSectionResultIsNull_ThrowsArgumentNullException() { // Call - TestDelegate test = () => new SectionResultWithCalculationAssignment(null, result => null, (result, calculation) => { }); + TestDelegate test = () => new SectionResultWithCalculationAssignment(null, result => null, (result, calculation) => {}); // Assert string paramName = Assert.Throws(test).ParamName; @@ -48,7 +48,7 @@ // Call TestDelegate test = () => new SectionResultWithCalculationAssignment(failureMechanismSectionResult, - null, (result, calculation) => { }); + null, (result, calculation) => {}); // Assert string paramName = Assert.Throws(test).ParamName; @@ -78,7 +78,7 @@ // Call var sectionResultWithCalculationAssignment = new SectionResultWithCalculationAssignment(failureMechanismSectionResult, - result => null, (result, calculation) => { }); + result => null, (result, calculation) => {}); // Assert Assert.AreSame(failureMechanismSectionResult, sectionResultWithCalculationAssignment.Result);