Index: Core/Components/src/Core.Components.Gis/Data/MapLineData.cs
===================================================================
diff -u -r38ee40c1f98ff4b1921d4de64fd032c8fbcadf92 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Core/Components/src/Core.Components.Gis/Data/MapLineData.cs (.../MapLineData.cs) (revision 38ee40c1f98ff4b1921d4de64fd032c8fbcadf92)
+++ Core/Components/src/Core.Components.Gis/Data/MapLineData.cs (.../MapLineData.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -50,7 +50,7 @@
///
/// The new features to validate.
/// Thrown when is null.
- /// Thrown when any feature in
+ /// Thrown when any feature in
/// contains multiple point-collections.
///
protected override void ValidateFeatures(MapFeature[] featuresToValidate)
Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructure.cs
===================================================================
diff -u -rad75a347a7586757599297f2b2e776100d827264 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructure.cs (.../ClosingStructure.cs) (revision ad75a347a7586757599297f2b2e776100d827264)
+++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructure.cs (.../ClosingStructure.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -53,8 +53,8 @@
/// The standard deviation of the threshold height of the opened closure structure.
/// The mean area of the flow aperture of the closing structure.
/// The standard deviation of the area of the flow aperture of the closing structure.
- /// The mean critical overtopping discharge of the closing structure.
- /// The standard deviation of critical overtopping discharge of the closing structure.
+ /// The mean critical overtopping discharge of the closing structure.
+ /// The standard deviation of critical overtopping discharge of the closing structure.
/// The mean flow width of the closing structure at the bottom protection.
/// The standard deviation of the flow width of the closing structure at the bottom protection.
/// The probability of the closing structure being open before flooding.
@@ -65,6 +65,7 @@
/// Thrown when or is null
/// , empty or consists of whitespace.
/// Thrown when is null.
+ /// Thrown when any parameter is out of range.
public ClosingStructure(string name, string id, Point2D location,
double storageStructureAreaMean, double storageStructureAreaStandardDeviation,
double allowedLevelIncreaseStorageMean, double allowedLevelIncreaseStorageStandardDeviation,
@@ -74,7 +75,7 @@
double insideWaterLevelMean, double insideWaterLevelStandardDeviation,
double thresholdHeightOpenWeirMean, double thresholdHeightOpenWeirStandardDeviation,
double areaFlowAperturesMean, double areaFlowAperturesStandardDeviation,
- double criticalOverToppingDischargeMean, double criticalOverToppingDischargeStandardDeviation,
+ double criticalOvertoppingDischargeMean, double criticalOvertoppingDischargeStandardDeviation,
double flowWidthAtBottomProtectionMean, double flowWidthAtBottomProtectionStandardDeviation,
double probabilityOpenStructureBeforeFlooding,
double failureProbablityOpenStructure,
@@ -120,10 +121,10 @@
Mean = new RoundedDouble(2, areaFlowAperturesMean),
StandardDeviation = new RoundedDouble(2, areaFlowAperturesStandardDeviation)
};
- CriticalOverToppingDischarge = new LogNormalDistribution(2)
+ CriticalOvertoppingDischarge = new LogNormalDistribution(2)
{
- Mean = new RoundedDouble(2, criticalOverToppingDischargeMean),
- StandardDeviation = new RoundedDouble(2, criticalOverToppingDischargeStandardDeviation)
+ Mean = new RoundedDouble(2, criticalOvertoppingDischargeMean),
+ StandardDeviation = new RoundedDouble(2, criticalOvertoppingDischargeStandardDeviation)
};
FlowWidthAtBottomProtection = new LogNormalDistribution(2)
{
@@ -180,7 +181,7 @@
///
/// Gets the critical overtopping discharge of the closing structure.
///
- public LogNormalDistribution CriticalOverToppingDischarge { get; private set; }
+ public LogNormalDistribution CriticalOvertoppingDischarge { get; private set; }
///
/// Gets the flow width of the closing structure at the bottom protection.
Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs
===================================================================
diff -u -ree9ea66795cde20ae1bd8a096333476e49d0d558 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs (.../ClosingStructuresInput.cs) (revision ee9ea66795cde20ae1bd8a096333476e49d0d558)
+++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs (.../ClosingStructuresInput.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -48,7 +48,7 @@
private readonly LogNormalDistribution flowWidthAtBottomProtection;
private readonly NormalDistribution widthFlowApertures;
private readonly LogNormalDistribution stormDuration;
- private readonly LogNormalDistribution criticalOverToppingDischarge;
+ private readonly LogNormalDistribution criticalOvertoppingDischarge;
private RoundedDouble structureNormalOrientation;
private RoundedDouble factorStormDurationOpenStructure;
private double failureProbablityOpenStructure;
@@ -126,11 +126,11 @@
StandardDeviation = (RoundedDouble) 0.05
};
- criticalOverToppingDischarge = new LogNormalDistribution(2)
+ criticalOvertoppingDischarge = new LogNormalDistribution(2)
{
Mean = (RoundedDouble) double.NaN
};
- criticalOverToppingDischarge.SetStandardDeviationFromVariationCoefficient(0.15);
+ criticalOvertoppingDischarge.SetStandardDeviationFromVariationCoefficient(0.15);
widthFlowApertures = new NormalDistribution(2)
{
@@ -533,16 +533,16 @@
/// Gets or sets the critical overtopping discharge.
/// [m^3/s/m]
///
- public LogNormalDistribution CriticalOverToppingDischarge
+ public LogNormalDistribution CriticalOvertoppingDischarge
{
get
{
- return criticalOverToppingDischarge;
+ return criticalOvertoppingDischarge;
}
set
{
- criticalOverToppingDischarge.Mean = value.Mean;
- criticalOverToppingDischarge.StandardDeviation = value.StandardDeviation;
+ criticalOvertoppingDischarge.Mean = value.Mean;
+ criticalOvertoppingDischarge.StandardDeviation = value.StandardDeviation;
}
}
Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PresentationObjects/ClosingStructuresCollectionContext.cs
===================================================================
diff -u -rad75a347a7586757599297f2b2e776100d827264 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PresentationObjects/ClosingStructuresCollectionContext.cs (.../ClosingStructuresCollectionContext.cs) (revision ad75a347a7586757599297f2b2e776100d827264)
+++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PresentationObjects/ClosingStructuresCollectionContext.cs (.../ClosingStructuresCollectionContext.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -28,7 +28,7 @@
namespace Ringtoets.ClosingStructures.Forms.PresentationObjects
{
///
- /// The presentation object for a collection of .
+ /// The presentation object for an containing .
///
public class ClosingStructuresCollectionContext : ObservableWrappedObjectContextBase>
{
Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/ClosingStructuresImporter.cs
===================================================================
diff -u -rad75a347a7586757599297f2b2e776100d827264 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/ClosingStructuresImporter.cs (.../ClosingStructuresImporter.cs) (revision ad75a347a7586757599297f2b2e776100d827264)
+++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/ClosingStructuresImporter.cs (.../ClosingStructuresImporter.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -37,8 +37,6 @@
///
public class ClosingStructuresImporter : StructuresImporter>
{
- private readonly ObservableList importTarget;
-
///
/// Creates a new instance of .
///
@@ -49,10 +47,7 @@
/// Thrown when ,
/// or is null.
public ClosingStructuresImporter(ObservableList importTarget, ReferenceLine referenceLine, string filePath)
- : base(importTarget, referenceLine, filePath)
- {
- this.importTarget = importTarget;
- }
+ : base(importTarget, referenceLine, filePath) {}
protected override void CreateSpecificStructures(ICollection structureLocations,
Dictionary> groupedStructureParameterRows)
@@ -61,10 +56,16 @@
foreach (ClosingStructure closingStructure in importedClosingStructures)
{
- importTarget.Add(closingStructure);
+ ImportTarget.Add(closingStructure);
}
}
+ protected override void HandleUserCancellingImport()
+ {
+ log.Info(RingtoetsCommonIOResources.StructuresImporter_User_cancelled);
+ base.HandleUserCancellingImport();
+ }
+
private IEnumerable CreateClosingStructures(IList structureLocations,
Dictionary> groupedStructureParameterRows)
{
@@ -77,8 +78,8 @@
if (!groupedStructureParameterRows.ContainsKey(id))
{
- log.WarnFormat(RingtoetsCommonIOResources.StructuresImporter_CreateSpecificStructures_no_structuresdata_for_location_0_, id);
- log.ErrorFormat("Kunstwerk nummer {0} wordt overgeslagen.", i + 1);
+ log.WarnFormat(RingtoetsCommonIOResources.StructuresImporter_CreateSpecificStructures_no_structuresdata_for_Location_0_, id);
+ log.ErrorFormat(RingtoetsCommonIOResources.StructuresImporter_Structure_number_0_is_skipped, i + 1);
continue;
}
@@ -91,6 +92,8 @@
continue;
}
+ ConvertVarianceToStandardDeviation(structureParameterRows);
+
ClosingStructure closingStructure = CreateClosingStructure(structureLocation, structureParameterRows);
closingStructures.Add(closingStructure);
}
Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructureTest.cs
===================================================================
diff -u -rad75a347a7586757599297f2b2e776100d827264 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructureTest.cs (.../ClosingStructureTest.cs) (revision ad75a347a7586757599297f2b2e776100d827264)
+++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructureTest.cs (.../ClosingStructureTest.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -115,12 +115,12 @@
Assert.AreEqual(2, areaFlowApertures.StandardDeviation.NumberOfDecimalPlaces);
Assert.AreEqual(0.89, areaFlowApertures.StandardDeviation.Value);
- var criticalOverToppingDischarge = structure.CriticalOverToppingDischarge;
- Assert.IsInstanceOf(criticalOverToppingDischarge);
- Assert.AreEqual(2, criticalOverToppingDischarge.Mean.NumberOfDecimalPlaces);
- Assert.AreEqual(901.23, criticalOverToppingDischarge.Mean.Value);
- Assert.AreEqual(2, criticalOverToppingDischarge.StandardDeviation.NumberOfDecimalPlaces);
- Assert.AreEqual(0.90, criticalOverToppingDischarge.StandardDeviation.Value);
+ var criticalOvertoppingDischarge = structure.CriticalOvertoppingDischarge;
+ Assert.IsInstanceOf(criticalOvertoppingDischarge);
+ Assert.AreEqual(2, criticalOvertoppingDischarge.Mean.NumberOfDecimalPlaces);
+ Assert.AreEqual(901.23, criticalOvertoppingDischarge.Mean.Value);
+ Assert.AreEqual(2, criticalOvertoppingDischarge.StandardDeviation.NumberOfDecimalPlaces);
+ Assert.AreEqual(0.90, criticalOvertoppingDischarge.StandardDeviation.Value);
var flowWidthAtBottomProtection = structure.FlowWidthAtBottomProtection;
Assert.IsInstanceOf(flowWidthAtBottomProtection);
Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresInputTest.cs
===================================================================
diff -u -rd5daf17a6ed66dddef590069e4db152f6250c2c3 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresInputTest.cs (.../ClosingStructuresInputTest.cs) (revision d5daf17a6ed66dddef590069e4db152f6250c2c3)
+++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresInputTest.cs (.../ClosingStructuresInputTest.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -85,7 +85,7 @@
Assert.IsNaN(input.StorageStructureArea.Mean);
Assert.IsNaN(input.FlowWidthAtBottomProtection.Mean);
AssertEqualValue(0.05, input.FlowWidthAtBottomProtection.StandardDeviation);
- Assert.IsNaN(input.CriticalOverToppingDischarge.Mean);
+ Assert.IsNaN(input.CriticalOvertoppingDischarge.Mean);
Assert.IsNaN(input.WidthFlowApertures.Mean);
AssertEqualValue(6.0, input.StormDuration.Mean);
AssertEqualValue(0.25, input.StormDuration.GetVariationCoefficient());
@@ -502,14 +502,14 @@
{
// Setup
var input = new ClosingStructuresInput();
- LogNormalDistribution criticalOverToppingDischarge = GenerateLogNormalDistribution();
+ LogNormalDistribution criticalOvertoppingDischarge = GenerateLogNormalDistribution();
//Call
- input.CriticalOverToppingDischarge = criticalOverToppingDischarge;
+ input.CriticalOvertoppingDischarge = criticalOvertoppingDischarge;
//Assert
- Assert.AreEqual(criticalOverToppingDischarge.Mean, input.CriticalOverToppingDischarge.Mean);
- AssertEqualValue(criticalOverToppingDischarge.StandardDeviation, input.CriticalOverToppingDischarge.StandardDeviation);
+ Assert.AreEqual(criticalOvertoppingDischarge.Mean, input.CriticalOvertoppingDischarge.Mean);
+ AssertEqualValue(criticalOvertoppingDischarge.StandardDeviation, input.CriticalOvertoppingDischarge.StandardDeviation);
}
[Test]
Index: Ringtoets/Common/src/Ringtoets.Common.Data/StructureBase.cs
===================================================================
diff -u -r0a6fd2fa18908a63fc029833ea3735709ebd5829 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/Common/src/Ringtoets.Common.Data/StructureBase.cs (.../StructureBase.cs) (revision 0a6fd2fa18908a63fc029833ea3735709ebd5829)
+++ Ringtoets/Common/src/Ringtoets.Common.Data/StructureBase.cs (.../StructureBase.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -42,11 +42,11 @@
{
if (string.IsNullOrWhiteSpace(name))
{
- throw new ArgumentException("name");
+ throw new ArgumentException("Parameter is null, empty or consists of whitespace.", "name");
}
if (string.IsNullOrWhiteSpace(id))
{
- throw new ArgumentException("id");
+ throw new ArgumentException("Parameter is null, empty or consists of whitespace.", "id");
}
if (location == null)
{
Index: Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/DikeProfilesImporter.cs
===================================================================
diff -u -rf27092df1f897798c4a0b24f6fc91f49c9f294ce -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/DikeProfilesImporter.cs (.../DikeProfilesImporter.cs) (revision f27092df1f897798c4a0b24f6fc91f49c9f294ce)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/DikeProfilesImporter.cs (.../DikeProfilesImporter.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -36,8 +36,6 @@
///
public class DikeProfilesImporter : ProfilesImporter>
{
- private readonly ObservableList importTarget;
-
///
/// Creates a new instance of .
///
@@ -48,10 +46,7 @@
/// Thrown when ,
/// or is null.
public DikeProfilesImporter(ObservableList importTarget, ReferenceLine referenceLine, string filePath)
- : base(referenceLine, filePath, importTarget)
- {
- this.importTarget = importTarget;
- }
+ : base(referenceLine, filePath, importTarget) {}
protected override void CreateProfiles(ReadResult importProfileLocationResult,
ReadResult importDikeProfileDataResult)
@@ -61,7 +56,7 @@
foreach (DikeProfile dikeProfile in importedDikeProfiles)
{
- importTarget.Add(dikeProfile);
+ ImportTarget.Add(dikeProfile);
}
}
Index: Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/ForeshoreProfilesImporter.cs
===================================================================
diff -u -rf27092df1f897798c4a0b24f6fc91f49c9f294ce -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/ForeshoreProfilesImporter.cs (.../ForeshoreProfilesImporter.cs) (revision f27092df1f897798c4a0b24f6fc91f49c9f294ce)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/ForeshoreProfilesImporter.cs (.../ForeshoreProfilesImporter.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -36,8 +36,6 @@
///
public class ForeshoreProfilesImporter : ProfilesImporter>
{
- private readonly ObservableList importTarget;
-
///
/// Creates a new instance of .
///
@@ -48,10 +46,7 @@
/// Thrown when ,
/// or is null.
public ForeshoreProfilesImporter(ObservableList importTarget, ReferenceLine referenceLine, string filePath)
- : base(referenceLine, filePath, importTarget)
- {
- this.importTarget = importTarget;
- }
+ : base(referenceLine, filePath, importTarget) {}
protected override void CreateProfiles(ReadResult importProfileLocationResult,
ReadResult importDikeProfileDataResult)
@@ -61,7 +56,7 @@
foreach (ForeshoreProfile foreshoreProfile in importedForeshoreProfiles)
{
- importTarget.Add(foreshoreProfile);
+ ImportTarget.Add(foreshoreProfile);
}
}
Index: Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/StructuresImporter.cs
===================================================================
diff -u -rad75a347a7586757599297f2b2e776100d827264 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/StructuresImporter.cs (.../StructuresImporter.cs) (revision ad75a347a7586757599297f2b2e776100d827264)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/StructuresImporter.cs (.../StructuresImporter.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -110,15 +110,32 @@
protected abstract void CreateSpecificStructures(ICollection structureLocations,
Dictionary> groupedStructureParameterRows);
- protected void LogMessages(ValidationResult validationResult, int i)
+ protected void LogMessages(ValidationResult validationResult, int lineNumber)
{
foreach (string message in validationResult.ErrorMessages)
{
log.Error(message);
}
- log.ErrorFormat("Kunstwerk nummer {0} wordt overgeslagen.", i);
+ log.ErrorFormat(Resources.StructuresImporter_Structure_number_0_is_skipped, lineNumber);
}
+ ///
+ /// Convert the variance in a into a standard deviation.
+ ///
+ /// The object to operate on.
+ protected void ConvertVarianceToStandardDeviation(List structureParameterRows)
+ {
+ foreach (StructuresParameterRow row in structureParameterRows)
+ {
+ if (row.VarianceType == VarianceType.CoefficientOfVariation)
+ {
+ log.WarnFormat(Resources.StructuresImporter_ConvertVarianceToStandardDeviation_Converting_variation_on_line_0_, row.LineNumber);
+ row.VarianceValue = row.VarianceValue*row.NumericalValue;
+ row.VarianceType = VarianceType.StandardDeviation;
+ }
+ }
+ }
+
private void CreateStructures(ReadResult importStructureLocationsResult,
ReadResult importStructureParameterRowsDataResult)
{
Index: Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs
===================================================================
diff -u -rf27092df1f897798c4a0b24f6fc91f49c9f294ce -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision f27092df1f897798c4a0b24f6fc91f49c9f294ce)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -1135,11 +1135,21 @@
}
///
+ /// Looks up a localized string similar to De variatie op regel {0} wordt omgerekend in een standaard deviatie..
+ ///
+ public static string StructuresImporter_ConvertVarianceToStandardDeviation_Converting_variation_on_line_0_ {
+ get {
+ return ResourceManager.GetString("StructuresImporter_ConvertVarianceToStandardDeviation_Converting_variation_on_lin" +
+ "e_0_", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Kan geen geldige gegevens vinden voor kunstwerklocatie met KWKIDENT '{0}'..
///
- public static string StructuresImporter_CreateSpecificStructures_no_structuresdata_for_location_0_ {
+ public static string StructuresImporter_CreateSpecificStructures_no_structuresdata_for_Location_0_ {
get {
- return ResourceManager.GetString("StructuresImporter_CreateSpecificStructures_no_structuresdata_for_location_0_", resourceCulture);
+ return ResourceManager.GetString("StructuresImporter_CreateSpecificStructures_no_structuresdata_for_Location_0_", resourceCulture);
}
}
@@ -1190,6 +1200,88 @@
}
///
+ /// Looks up a localized string similar to Kunstwerk nummer {0} wordt overgeslagen..
+ ///
+ public static string StructuresImporter_Structure_number_0_is_skipped {
+ get {
+ return ResourceManager.GetString("StructuresImporter_Structure_number_0_is_skipped", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Kunstwerken importeren is afgebroken. Geen gegevens ingelezen..
+ ///
+ public static string StructuresImporter_User_cancelled {
+ get {
+ return ResourceManager.GetString("StructuresImporter_User_cancelled", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to De waarde op regel {0}, kolom {1} valt buiten het bereik [0, 360]..
+ ///
+ public static string StructuresParameterRowsValidator_Line_0_column_1_orientation_out_of_range {
+ get {
+ return ResourceManager.GetString("StructuresParameterRowsValidator_Line_0_column_1_orientation_out_of_range", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to De waarde op regel {0}, kolom {1} valt buiten het bereik [0, 1]..
+ ///
+ public static string StructuresParameterRowsValidator_Line_0_column_1_probability_out_of_range {
+ get {
+ return ResourceManager.GetString("StructuresParameterRowsValidator_Line_0_column_1_probability_out_of_range", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to De waarde op regel {0}, kolom {1} valt buiten het bereik [0, 2]..
+ ///
+ public static string StructuresParameterRowsValidator_Line_0_column_1_type_out_of_range {
+ get {
+ return ResourceManager.GetString("StructuresParameterRowsValidator_Line_0_column_1_type_out_of_range", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to De waarde op regel {0}, kolom {1} mag niet kleiner dan nul zijn..
+ ///
+ public static string StructuresParameterRowsValidator_Line_0_column_1_value_cannot_be_smaller_than_zero {
+ get {
+ return ResourceManager.GetString("StructuresParameterRowsValidator_Line_0_column_1_value_cannot_be_smaller_than_zer" +
+ "o", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to De waarde op regel {0}, kolom {1} is ongeldig..
+ ///
+ public static string StructuresParameterRowsValidator_Line_0_column_1_value_invalid {
+ get {
+ return ResourceManager.GetString("StructuresParameterRowsValidator_Line_0_column_1_value_invalid", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Parameter '{0}' ontbreekt..
+ ///
+ public static string StructuresParameterRowsValidator_Parameter_0_missing {
+ get {
+ return ResourceManager.GetString("StructuresParameterRowsValidator_Parameter_0_missing", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Parameter '{0}' komt meermaals voor..
+ ///
+ public static string StructuresParameterRowsValidator_Parameter_0_repeated {
+ get {
+ return ResourceManager.GetString("StructuresParameterRowsValidator_Parameter_0_repeated", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Het kunstwerk heeft geen geldige waarde voor attribuut '{0}'..
///
public static string StructuresReader_GetNextStructure_Invalid_KWKIDENT {
Index: Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx
===================================================================
diff -u -rf27092df1f897798c4a0b24f6fc91f49c9f294ce -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx (.../Resources.resx) (revision f27092df1f897798c4a0b24f6fc91f49c9f294ce)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx (.../Resources.resx) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -356,7 +356,7 @@
Inlezen van kunstwerkgegevens.
-
+
Kan geen geldige gegevens vinden voor kunstwerklocatie met KWKIDENT '{0}'.
@@ -438,4 +438,34 @@
Inlezen van profiellocaties uit een shapebestand.
+
+ Kunstwerken importeren is afgebroken. Geen gegevens ingelezen.
+
+
+ Kunstwerk nummer {0} wordt overgeslagen.
+
+
+ Parameter '{0}' ontbreekt.
+
+
+ Parameter '{0}' komt meermaals voor.
+
+
+ De waarde op regel {0}, kolom {1} valt buiten het bereik [0, 1].
+
+
+ De waarde op regel {0}, kolom {1} is ongeldig.
+
+
+ De waarde op regel {0}, kolom {1} valt buiten het bereik [0, 360].
+
+
+ De waarde op regel {0}, kolom {1} mag niet kleiner dan nul zijn.
+
+
+ De waarde op regel {0}, kolom {1} valt buiten het bereik [0, 2].
+
+
+ De variatie op regel {0} wordt omgerekend in een standaard deviatie.
+
\ No newline at end of file
Index: Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj
===================================================================
diff -u -rf27092df1f897798c4a0b24f6fc91f49c9f294ce -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj (.../Ringtoets.Common.IO.csproj) (revision f27092df1f897798c4a0b24f6fc91f49c9f294ce)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj (.../Ringtoets.Common.IO.csproj) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -77,13 +77,14 @@
+
-
+
Index: Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructureFilesKeywords.cs
===================================================================
diff -u
--- Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructureFilesKeywords.cs (revision 0)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructureFilesKeywords.cs (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -0,0 +1,69 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+namespace Ringtoets.Common.IO.Structures
+{
+ ///
+ /// The keywords as used in structure files.
+ ///
+ public static class StructureFilesKeywords
+ {
+ ///
+ /// The first height structure parameter keyword.
+ ///
+ public const string HeightStructureParameterKeyword1 = "KW_HOOGTE1";
+
+ ///
+ /// The second height structure parameter keyword.
+ ///
+ public const string HeightStructureParameterKeyword2 = "KW_HOOGTE2";
+
+ ///
+ /// The third height structure parameter keyword.
+ ///
+ public const string HeightStructureParameterKeyword3 = "KW_HOOGTE3";
+
+ ///
+ /// The fourth height structure parameter keyword.
+ ///
+ public const string HeightStructureParameterKeyword4 = "KW_HOOGTE4";
+
+ ///
+ /// The fifth height structure parameter keyword.
+ ///
+ public const string HeightStructureParameterKeyword5 = "KW_HOOGTE5";
+
+ ///
+ /// The sixth height structure parameter keyword.
+ ///
+ public const string HeightStructureParameterKeyword6 = "KW_HOOGTE6";
+
+ ///
+ /// The seventh height structure parameter keyword.
+ ///
+ public const string HeightStructureParameterKeyword7 = "KW_HOOGTE7";
+
+ ///
+ /// The eighth height structure parameter keyword.
+ ///
+ public const string HeightStructureParameterKeyword8 = "KW_HOOGTE8";
+ }
+}
\ No newline at end of file
Index: Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresParameterRowsValidator.cs
===================================================================
diff -u -r0d12e759b6e46290d83d04a6a5760fe467b339ab -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresParameterRowsValidator.cs (.../StructuresParameterRowsValidator.cs) (revision 0d12e759b6e46290d83d04a6a5760fe467b339ab)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresParameterRowsValidator.cs (.../StructuresParameterRowsValidator.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -22,6 +22,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using Ringtoets.Common.IO.Properties;
namespace Ringtoets.Common.IO.Structures
{
@@ -30,79 +31,83 @@
///
public static class StructuresParameterRowsValidator
{
+ private const int numericalValueColumn = 18;
+ private const int varianceValueColumn = 19;
+ private const int varianceTypeColumn = 20;
+
private static readonly Dictionary>> heightStructuresRules =
new Dictionary>>
{
{
"KW_HOOGTE1", StructureNormalOrientation
},
{
- "KW_HOOGTE2", LevelCrestStructure
+ "KW_HOOGTE2", DistributionRule
},
{
- "KW_HOOGTE3", FlowWidthAtBottomProtection
+ "KW_HOOGTE3", DistributionRule
},
{
- "KW_HOOGTE4", CriticalOvertoppingDischarge
+ "KW_HOOGTE4", DistributionRule
},
{
- "KW_HOOGTE5", WidthFlowApertures
+ "KW_HOOGTE5", DistributionRule
},
{
- "KW_HOOGTE6", FailureProbabilityStructureWithErosion
+ "KW_HOOGTE6", ProbabilityRule
},
{
- "KW_HOOGTE7", StorageStructureArea
+ "KW_HOOGTE7", DistributionRule
},
{
- "KW_HOOGTE8", AllowedLevelIncreaseStorage
+ "KW_HOOGTE8", DistributionRule
}
};
private static readonly Dictionary>> closingStructuresRules =
new Dictionary>>
{
{
- "KW_BETSLUIT1", StorageStructureArea
+ "KW_BETSLUIT1", DistributionRule
},
{
- "KW_BETSLUIT2", AllowedLevelIncreaseStorage
+ "KW_BETSLUIT2", DistributionRule
},
{
"KW_BETSLUIT3", StructureNormalOrientation
},
{
- "KW_BETSLUIT4", WidthFlowApertures
+ "KW_BETSLUIT4", DistributionRule
},
{
- "KW_BETSLUIT5", LevelCrestStructureNotClosing
+ "KW_BETSLUIT5", DistributionRule
},
{
- "KW_BETSLUIT6", InsideWaterLevel
+ "KW_BETSLUIT6", DistributionRule
},
{
- "KW_BETSLUIT7", ThresholdHeightOpenWeir
+ "KW_BETSLUIT7", DistributionRule
},
{
- "KW_BETSLUIT8", AreaFlowApertures
+ "KW_BETSLUIT8", DistributionRule
},
{
- "KW_BETSLUIT9", CriticalOvertoppingDischarge
+ "KW_BETSLUIT9", DistributionRule
},
{
- "KW_BETSLUIT10", FlowWidthAtBottomProtection
+ "KW_BETSLUIT10", DistributionRule
},
{
- "KW_BETSLUIT11", ProbabilityOpenStructureBeforeFlooding
+ "KW_BETSLUIT11", ProbabilityRule
},
{
- "KW_BETSLUIT12", FailureProbablityOpenStructure
+ "KW_BETSLUIT12", ProbabilityRule
},
{
"KW_BETSLUIT13", NumberOfIdenticalApertures
},
{
- "KW_BETSLUIT14", FailureProbabilityReparation
+ "KW_BETSLUIT14", ProbabilityRule
},
{
"KW_BETSLUIT15", InflowModel
@@ -143,272 +148,96 @@
foreach (string name in rules.Keys)
{
- int count = structureParameterRows.Count(row => row.ParameterId.Equals(name));
+ int count = structureParameterRows.Count(row => string.Equals(row.ParameterId, name, StringComparison.OrdinalIgnoreCase));
if (count < 1)
{
- errorMessages.Add(string.Format("Parameter '{0}' ontbreekt.", name));
+ errorMessages.Add(string.Format(Resources.StructuresParameterRowsValidator_Parameter_0_missing, name));
continue;
}
if (count > 1)
{
- errorMessages.Add(string.Format("Parameter '{0}' komt meermaals voor.", name));
+ errorMessages.Add(string.Format(Resources.StructuresParameterRowsValidator_Parameter_0_repeated, name));
}
- errorMessages.AddRange(rules[name](structureParameterRows.First(row => row.ParameterId.Equals(name))));
+ errorMessages.AddRange(rules[name](structureParameterRows.First(row => string.Equals(row.ParameterId, name, StringComparison.OrdinalIgnoreCase))));
}
return new ValidationResult(errorMessages);
}
- #region SharedRules
-
- private static List StorageStructureArea(StructuresParameterRow row)
+ private static List ProbabilityRule(StructuresParameterRow row)
{
List messages = new List();
- double meanArea = row.NumericalValue;
- if (double.IsNaN(meanArea) || double.IsInfinity(meanArea))
- {
- messages.Add("Het kombergend oppervlak van het kunstwerk heeft een ongeldige waarde.");
- }
- double variance = row.VarianceValue;
- if (double.IsNaN(variance) || double.IsInfinity(variance) || variance < 0.0 || row.VarianceType != VarianceType.CoefficientOfVariation)
- {
- messages.Add("De variantie van de kombergend oppervlak lognormaalverdeling heeft een ongeldige waarde.");
- }
- return messages;
- }
- private static List AllowedLevelIncreaseStorage(StructuresParameterRow row)
- {
- List messages = new List();
- double meanAllowableIncrease = row.NumericalValue;
- if (double.IsNaN(meanAllowableIncrease) || double.IsInfinity(meanAllowableIncrease))
+ double mean = row.NumericalValue;
+ if (double.IsNaN(mean) || double.IsInfinity(mean))
{
- messages.Add("De toegestane peilverhoging op het kombergend oppervlak van het kunstwerk heeft een ongeldige waarde.");
+ messages.Add(string.Format(Resources.StructuresParameterRowsValidator_Line_0_column_1_probability_out_of_range, row.LineNumber, numericalValueColumn));
}
- double variance = row.VarianceValue;
- if (double.IsNaN(variance) || double.IsInfinity(variance) || variance < 0.0 || row.VarianceType != VarianceType.CoefficientOfVariation)
- {
- messages.Add("De variantie van de toegestane peilverhoging op het kombergend oppervlak lognormaalverdeling heeft een ongeldige waarde.");
- }
- return messages;
- }
- private static List StructureNormalOrientation(StructuresParameterRow row)
- {
- List messages = new List();
- double orientation = row.NumericalValue;
- if (!(orientation >= 0 && orientation <= 360))
- {
- messages.Add("De oriëntatie van het kunstwerk valt buiten het bereik [0, 360].");
- }
return messages;
}
- private static List WidthFlowApertures(StructuresParameterRow row)
+ private static List DistributionRule(StructuresParameterRow row)
{
List messages = new List();
- double meanWidth = row.NumericalValue;
- if (double.IsNaN(meanWidth) || double.IsInfinity(meanWidth))
- {
- messages.Add("De breedte van de kruin van het kunstwerk heeft een ongeldige waarde.");
- }
- double variance = row.VarianceValue;
- if (double.IsNaN(variance) || double.IsInfinity(variance) || variance < 0.0 || row.VarianceType != VarianceType.StandardDeviation)
- {
- messages.Add("De standaard afwijking van de breedte van de kruin normaalverdeling heeft een ongeldige waarde.");
- }
- return messages;
- }
- private static List CriticalOvertoppingDischarge(StructuresParameterRow row)
- {
- List messages = new List();
- double meanDischange = row.NumericalValue;
- if (double.IsNaN(meanDischange) || double.IsInfinity(meanDischange))
+ double mean = row.NumericalValue;
+ if (double.IsNaN(mean) || double.IsInfinity(mean))
{
- messages.Add("Het kritieke overslagdebiet per strekkende meter van het kunstwerk heeft een ongeldige waarde.");
+ messages.Add(string.Format(Resources.StructuresParameterRowsValidator_Line_0_column_1_value_invalid, row.LineNumber, numericalValueColumn));
}
- double variance = row.VarianceValue;
- if (double.IsNaN(variance) || double.IsInfinity(variance) || variance < 0.0 || row.VarianceType != VarianceType.CoefficientOfVariation)
- {
- messages.Add("De variantie van de kritieke overslagdebiet per strekkende meter lognormaalverdeling heeft een ongeldige waarde.");
- }
- return messages;
- }
- private static List FlowWidthAtBottomProtection(StructuresParameterRow row)
- {
- List messages = new List();
- double meanFlowWidth = row.NumericalValue;
- if (double.IsNaN(meanFlowWidth) || double.IsInfinity(meanFlowWidth))
+ VarianceType type = row.VarianceType;
+ if (type != VarianceType.StandardDeviation && type != VarianceType.CoefficientOfVariation)
{
- messages.Add("De stroomvoerende breedte bij bodembescherming van het kunstwerk heeft een ongeldige waarde.");
+ messages.Add(string.Format(Resources.StructuresParameterRowsValidator_Line_0_column_1_value_invalid, row.LineNumber, varianceTypeColumn));
}
- double variance = row.VarianceValue;
- if (double.IsNaN(variance) || double.IsInfinity(variance) || variance < 0.0 || row.VarianceType != VarianceType.CoefficientOfVariation)
- {
- messages.Add("De variantie van de stroomvoerende breedte bij bodembescherming lognormaalverdeling heeft een ongeldige waarde.");
- }
- return messages;
- }
- #endregion
-
- #region HeightStructuesRules
-
- private static List LevelCrestStructure(StructuresParameterRow row)
- {
- List messages = new List();
- double meanCrestLevel = row.NumericalValue;
- if (double.IsNaN(meanCrestLevel) || double.IsInfinity(meanCrestLevel))
- {
- messages.Add("De kerende hoogte van het kunstwerk heeft een ongeldige waarde.");
- }
double variance = row.VarianceValue;
- if (double.IsNaN(variance) || double.IsInfinity(variance) || variance < 0.0 || row.VarianceType != VarianceType.StandardDeviation)
+ if (double.IsNaN(variance) || double.IsInfinity(variance) || variance < 0.0)
{
- messages.Add("De standaard afwijking van de kerende hoogte normaalverdeling heeft een ongeldige waarde.");
+ messages.Add(string.Format(Resources.StructuresParameterRowsValidator_Line_0_column_1_value_invalid, row.LineNumber, varianceValueColumn));
}
- return messages;
- }
- private static List FailureProbabilityStructureWithErosion(StructuresParameterRow row)
- {
- List messages = new List();
- double failureProbability = row.NumericalValue;
- if (failureProbability < 0.0 || failureProbability > 1.0)
- {
- messages.Add("De waarde voor de faalkans van het kunstwerk valt buiten het bereik [0, 1].");
- }
return messages;
}
- #endregion
-
- #region ClosureStructuresRules
-
- private static List LevelCrestStructureNotClosing(StructuresParameterRow row)
+ private static List StructureNormalOrientation(StructuresParameterRow row)
{
List messages = new List();
- double meanCrestLevel = row.NumericalValue;
- if (double.IsNaN(meanCrestLevel) || double.IsInfinity(meanCrestLevel))
- {
- messages.Add("De kruinhoogte niet gesloten kering van het kunstwerk heeft een ongeldige waarde.");
- }
- double variance = row.VarianceValue;
- if (double.IsNaN(variance) || double.IsInfinity(variance) || variance < 0.0 || row.VarianceType != VarianceType.StandardDeviation)
- {
- messages.Add("De standaard afwijking van de kruinhoogte niet gesloten kering normaalverdeling heeft een ongeldige waarde.");
- }
- return messages;
- }
- private static List InsideWaterLevel(StructuresParameterRow row)
- {
- List messages = new List();
- double meanInsideWaterLevel = row.NumericalValue;
- if (double.IsNaN(meanInsideWaterLevel) || double.IsInfinity(meanInsideWaterLevel))
+ double orientation = row.NumericalValue;
+ if (!(orientation >= 0 && orientation <= 360))
{
- messages.Add("De binnenwaterstand van het kunstwerk heeft een ongeldige waarde.");
+ messages.Add(string.Format(Resources.StructuresParameterRowsValidator_Line_0_column_1_orientation_out_of_range, row.LineNumber, numericalValueColumn));
}
- double variance = row.VarianceValue;
- if (double.IsNaN(variance) || double.IsInfinity(variance) || variance < 0.0 || row.VarianceType != VarianceType.StandardDeviation)
- {
- messages.Add("De standaard afwijking van de binnenwaterstand normaalverdeling heeft een ongeldige waarde.");
- }
- return messages;
- }
- private static List ThresholdHeightOpenWeir(StructuresParameterRow row)
- {
- List messages = new List();
- double meanThreshold = row.NumericalValue;
- if (double.IsNaN(meanThreshold) || double.IsInfinity(meanThreshold))
- {
- messages.Add("De drempelhoogte van het kunstwerk heeft een ongeldige waarde.");
- }
- double variance = row.VarianceValue;
- if (double.IsNaN(variance) || double.IsInfinity(variance) || variance < 0.0 || row.VarianceType != VarianceType.StandardDeviation)
- {
- messages.Add("De standaard afwijking van de drempelhoogte normaalverdeling heeft een ongeldige waarde.");
- }
return messages;
}
- private static List AreaFlowApertures(StructuresParameterRow row)
- {
- List messages = new List();
- double meanArea = row.NumericalValue;
- if (double.IsNaN(meanArea) || double.IsInfinity(meanArea))
- {
- messages.Add("Het doorstroomoppervlak van het kunstwerk heeft een ongeldige waarde.");
- }
- double variance = row.VarianceValue;
- if (double.IsNaN(variance) || double.IsInfinity(variance) || variance < 0.0 || row.VarianceType != VarianceType.CoefficientOfVariation)
- {
- messages.Add("De variantie van het doorstroomoppervlak lognormaalverdeling heeft een ongeldige waarde.");
- }
- return messages;
- }
-
- private static List ProbabilityOpenStructureBeforeFlooding(StructuresParameterRow row)
- {
- List messages = new List();
- double value = row.NumericalValue;
- if (!(value >= 0 && value <= 1))
- {
- messages.Add("De kans op open staan bij naderend hoogwater heeft een ongeldige waarde.");
- }
- return messages;
- }
-
- private static List FailureProbablityOpenStructure(StructuresParameterRow row)
- {
- List messages = new List();
- double value = row.NumericalValue;
- if (!(value >= 0 && value <= 1))
- {
- messages.Add("De kans op mislukken sluiting van geopend kunstwerk heeft een ongeldige waarde.");
- }
- return messages;
- }
-
private static List NumberOfIdenticalApertures(StructuresParameterRow row)
{
List messages = new List();
double value = row.NumericalValue;
if (value < 0)
{
- messages.Add("Het aantal identieke doorstroomopeningen heeft een ongeldige waarde.");
+ messages.Add(string.Format(Resources.StructuresParameterRowsValidator_Line_0_column_1_value_cannot_be_smaller_than_zero, row.LineNumber, numericalValueColumn));
}
return messages;
}
- private static List FailureProbabilityReparation(StructuresParameterRow row)
- {
- List messages = new List();
- double value = row.NumericalValue;
- if (!(value >= 0 && value <= 1))
- {
- messages.Add("De faalkans herstel van gefaalde situatie heeft een ongeldige waarde.");
- }
- return messages;
- }
-
private static List InflowModel(StructuresParameterRow row)
{
List messages = new List();
double value = row.NumericalValue;
- if (value < 0)
+ if (!(value >= 0) && (value <= 2))
{
- messages.Add("Het instroommodel heeft een ongeldige waarde.");
+ messages.Add(string.Format(Resources.StructuresParameterRowsValidator_Line_0_column_1_type_out_of_range, row.LineNumber, numericalValueColumn));
}
return messages;
}
-
- #endregion
}
}
\ No newline at end of file
Index: Ringtoets/Common/src/Ringtoets.Common.IO/Structures/ValidationResult.cs
===================================================================
diff -u
--- Ringtoets/Common/src/Ringtoets.Common.IO/Structures/ValidationResult.cs (revision 0)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Structures/ValidationResult.cs (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -0,0 +1,73 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Ringtoets.Common.IO.Structures
+{
+ ///
+ /// This class represents the result of a validation.
+ ///
+ public class ValidationResult
+ {
+ private readonly List errorMessages = new List();
+
+ ///
+ /// Create a new instance of .
+ ///
+ /// The error messages for this .
+ /// Thrown when is null.
+ /// Thrown when any message in is null,
+ /// empty or consists of whitespace.
+ public ValidationResult(ICollection errorMessages)
+ {
+ if (errorMessages == null)
+ {
+ throw new ArgumentNullException("errorMessages");
+ }
+ if (errorMessages.Any(string.IsNullOrWhiteSpace))
+ {
+ throw new ArgumentException("Invalid error message string.");
+ }
+
+ IsValid = errorMessages.Count < 1;
+ this.errorMessages.AddRange(errorMessages);
+ }
+
+ ///
+ /// Gets a value which indicates whether the validation subject is valid.
+ ///
+ public bool IsValid { get; private set; }
+
+ ///
+ /// Gets the error messages resulting from the validation.
+ ///
+ public IEnumerable ErrorMessages
+ {
+ get
+ {
+ return errorMessages;
+ }
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 2f6400116d57c2b49f7089dbc9c8cd935c185a36 refers to a dead (removed) revision in file `Ringtoets/Common/src/Ringtoets.Common.IO/ValidationResult.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/StructureBaseTest.cs
===================================================================
diff -u -r0a6fd2fa18908a63fc029833ea3735709ebd5829 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/Common/test/Ringtoets.Common.Data.Test/StructureBaseTest.cs (.../StructureBaseTest.cs) (revision 0a6fd2fa18908a63fc029833ea3735709ebd5829)
+++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/StructureBaseTest.cs (.../StructureBaseTest.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -39,7 +39,8 @@
TestDelegate call = () => new TestStructure(name, "anId", new Point2D(0, 0));
// Assert
- TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, "name");
+ ArgumentException exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, "Parameter is null, empty or consists of whitespace.");
+ Assert.AreEqual("name", exception.ParamName);
}
[Test]
@@ -52,7 +53,8 @@
TestDelegate call = () => new TestStructure("aName", id, new Point2D(0, 0));
// Assert
- TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, "id");
+ ArgumentException exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, "Parameter is null, empty or consists of whitespace.");
+ Assert.AreEqual("id", exception.ParamName);
}
[Test]
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/ProfilesImporterTest.cs
===================================================================
diff -u -rf27092df1f897798c4a0b24f6fc91f49c9f294ce -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/ProfilesImporterTest.cs (.../ProfilesImporterTest.cs) (revision f27092df1f897798c4a0b24f6fc91f49c9f294ce)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/ProfilesImporterTest.cs (.../ProfilesImporterTest.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -495,7 +495,7 @@
testProfilesImporter.Cancel();
bool importResult = testProfilesImporter.Import();
-
+
// Precondition
Assert.IsFalse(importResult);
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/StructuresImporterTest.cs
===================================================================
diff -u -r1d6be87de63acfac543d4b90aaf0618d3203b0c3 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/StructuresImporterTest.cs (.../StructuresImporterTest.cs) (revision 1d6be87de63acfac543d4b90aaf0618d3203b0c3)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/StructuresImporterTest.cs (.../StructuresImporterTest.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -129,7 +129,7 @@
{
string message = messages.First();
string expectedMessage = new FileReaderErrorMessageBuilder(invalidPath)
- .Build(string.Format(CoreCommonUtilsResources.Error_Path_cannot_contain_Characters_0_, string.Join(", ", Path.GetInvalidFileNameChars())));
+ .Build(string.Format(CoreCommonUtilsResources.Error_Path_cannot_contain_Characters_0_, string.Join(", ", invalidFileNameChars)));
StringAssert.StartsWith(expectedMessage, message);
});
Assert.IsFalse(importResult);
@@ -148,14 +148,9 @@
Action call = () => importResult = testStructuresImporter.Import();
// Assert
- TestHelper.AssertLogMessages(call, messages =>
- {
- string[] messageArray = messages.ToArray();
- string expectedMessage = new FileReaderErrorMessageBuilder(folderPath)
- .Build(CoreCommonUtilsResources.Error_Path_must_not_point_to_empty_file_name);
- StringAssert.StartsWith(expectedMessage, messageArray[0]);
- });
- Assert.IsFalse(importResult);
+ string expectedMessage = new FileReaderErrorMessageBuilder(folderPath)
+ .Build(CoreCommonUtilsResources.Error_Path_must_not_point_to_empty_file_name);
+ TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1);
}
[Test]
@@ -178,14 +173,9 @@
Action call = () => importResult = profilesImporter.Import();
// Assert
- TestHelper.AssertLogMessages(call, messages =>
- {
- string[] messageArray = messages.ToArray();
- string expectedMessage =
- string.Format("Fout bij het lezen van bestand '{0}': Kon geen punten vinden in dit bestand.", filePath);
- StringAssert.EndsWith(expectedMessage, messageArray[0]);
- });
- Assert.IsFalse(importResult);
+ string expectedMessage =
+ string.Format("Fout bij het lezen van bestand '{0}': Kon geen punten vinden in dit bestand.", filePath);
+ TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1);
}
[Test]
@@ -268,7 +258,8 @@
};
ReferenceLine referenceLine = new ReferenceLine();
referenceLine.SetGeometry(referencePoints);
- var testStructuresImporter = new TestStructuresImporter(new ObservableList(), referenceLine, filePath);
+ var importTarget = new ObservableList();
+ var testStructuresImporter = new TestStructuresImporter(importTarget, referenceLine, filePath);
testStructuresImporter.Cancel();
bool importResult = testStructuresImporter.Import();
@@ -341,13 +332,8 @@
Action call = () => importResult = testStructuresImporter.Import();
// Assert
- TestHelper.AssertLogMessages(call, messages =>
- {
- string[] messageArray = messages.ToArray();
- string expectedMessage = "Kunstwerklocatie met KWKIDENT 'KUNST3' is opnieuw ingelezen.";
- StringAssert.StartsWith(expectedMessage, messageArray[0]);
- });
- Assert.IsTrue(importResult);
+ string expectedMessage = "Kunstwerklocatie met KWKIDENT 'KUNST3' is opnieuw ingelezen.";
+ TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1);
}
[Test]
@@ -375,13 +361,8 @@
Action call = () => importResult = testStructuresImporter.Import();
// Assert
- TestHelper.AssertLogMessages(call, messages =>
- {
- string[] messageArray = messages.ToArray();
- string expectedMessage = "Fout bij het lezen van kunstwerk op regel 1. Het kunstwerk heeft geen geldige waarde voor attribuut 'KWKIDENT'. Dit kunstwerk wordt overgeslagen.";
- StringAssert.StartsWith(expectedMessage, messageArray[0]);
- });
- Assert.IsFalse(importResult);
+ string expectedMessage = "Fout bij het lezen van kunstwerk op regel 1. Het kunstwerk heeft geen geldige waarde voor attribuut 'KWKIDENT'. Dit kunstwerk wordt overgeslagen.";
+ TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1);
}
[Test]
@@ -405,7 +386,7 @@
var testStructuresImporter = new TestStructuresImporter(new ObservableList(), referenceLine, filePath);
// Call
- var importResult = testStructuresImporter.Import();
+ var importResult = testStructuresImporter.Import();
// Assert
Assert.IsFalse(importResult);
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Ringtoets.Common.IO.Test.csproj
===================================================================
diff -u -r8871a82c0575b2e45b3cf28a97b08117accc19e1 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Ringtoets.Common.IO.Test.csproj (.../Ringtoets.Common.IO.Test.csproj) (revision 8871a82c0575b2e45b3cf28a97b08117accc19e1)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Ringtoets.Common.IO.Test.csproj (.../Ringtoets.Common.IO.Test.csproj) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -84,7 +84,7 @@
-
+
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructuresParameterRowsValidatorTest.cs
===================================================================
diff -u -rad75a347a7586757599297f2b2e776100d827264 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructuresParameterRowsValidatorTest.cs (.../StructuresParameterRowsValidatorTest.cs) (revision ad75a347a7586757599297f2b2e776100d827264)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructuresParameterRowsValidatorTest.cs (.../StructuresParameterRowsValidatorTest.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -46,7 +46,7 @@
// Setup
var structuresParameterRow = new StructuresParameterRow
{
- ParameterId = "KW_HOOGTE1",
+ ParameterId = StructureFilesKeywords.HeightStructureParameterKeyword1,
NumericalValue = 180.0
};
@@ -83,51 +83,51 @@
{
new StructuresParameterRow
{
- ParameterId = "KW_HOOGTE1",
+ ParameterId = StructureFilesKeywords.HeightStructureParameterKeyword1,
NumericalValue = double.NaN
},
new StructuresParameterRow
{
- ParameterId = "KW_HOOGTE2",
+ ParameterId = StructureFilesKeywords.HeightStructureParameterKeyword2,
NumericalValue = double.NaN,
VarianceValue = -10.0
},
new StructuresParameterRow
{
- ParameterId = "KW_HOOGTE3",
+ ParameterId = StructureFilesKeywords.HeightStructureParameterKeyword3,
NumericalValue = double.NaN,
VarianceValue = double.NaN
},
new StructuresParameterRow
{
- ParameterId = "KW_HOOGTE4",
+ ParameterId = StructureFilesKeywords.HeightStructureParameterKeyword4,
NumericalValue = double.PositiveInfinity,
VarianceValue = double.PositiveInfinity
},
new StructuresParameterRow
{
- ParameterId = "KW_HOOGTE5",
+ ParameterId = StructureFilesKeywords.HeightStructureParameterKeyword5,
NumericalValue = double.PositiveInfinity,
VarianceValue = 10.0,
VarianceType = VarianceType.NotSpecified
},
new StructuresParameterRow
{
- ParameterId = "KW_HOOGTE6",
+ ParameterId = StructureFilesKeywords.HeightStructureParameterKeyword6,
NumericalValue = double.NegativeInfinity
},
new StructuresParameterRow
{
- ParameterId = "KW_HOOGTE7",
+ ParameterId = StructureFilesKeywords.HeightStructureParameterKeyword7,
NumericalValue = double.NegativeInfinity,
VarianceValue = -10.0
},
new StructuresParameterRow
{
- ParameterId = "KW_HOOGTE8",
- NumericalValue = double.PositiveInfinity,
+ ParameterId = StructureFilesKeywords.HeightStructureParameterKeyword8,
+ NumericalValue = 0,
VarianceValue = 10.0,
- VarianceType = VarianceType.StandardDeviation
+ VarianceType = VarianceType.CoefficientOfVariation
}
};
@@ -138,20 +138,23 @@
Assert.IsFalse(validationResult.IsValid);
List expectedErrorMessages = new List
{
- "De oriëntatie van het kunstwerk valt buiten het bereik [0, 360].",
- "De kerende hoogte van het kunstwerk heeft een ongeldige waarde.",
- "De standaard afwijking van de kerende hoogte normaalverdeling heeft een ongeldige waarde.",
- "De stroomvoerende breedte bij bodembescherming van het kunstwerk heeft een ongeldige waarde.",
- "De variantie van de stroomvoerende breedte bij bodembescherming lognormaalverdeling heeft een ongeldige waarde.",
- "Het kritieke overslagdebiet per strekkende meter van het kunstwerk heeft een ongeldige waarde.",
- "De variantie van de kritieke overslagdebiet per strekkende meter lognormaalverdeling heeft een ongeldige waarde.",
- "De breedte van de kruin van het kunstwerk heeft een ongeldige waarde.",
- "De standaard afwijking van de breedte van de kruin normaalverdeling heeft een ongeldige waarde.",
- "De waarde voor de faalkans van het kunstwerk valt buiten het bereik [0, 1].",
- "Het kombergend oppervlak van het kunstwerk heeft een ongeldige waarde.",
- "De variantie van de kombergend oppervlak lognormaalverdeling heeft een ongeldige waarde.",
- "De toegestane peilverhoging op het kombergend oppervlak van het kunstwerk heeft een ongeldige waarde.",
- "De variantie van de toegestane peilverhoging op het kombergend oppervlak lognormaalverdeling heeft een ongeldige waarde."
+ "De waarde op regel -1, kolom 18 valt buiten het bereik [0, 360].",
+ "De waarde op regel -1, kolom 18 is ongeldig.",
+ "De waarde op regel -1, kolom 20 is ongeldig.",
+ "De waarde op regel -1, kolom 19 is ongeldig.",
+ "De waarde op regel -1, kolom 18 is ongeldig.",
+ "De waarde op regel -1, kolom 20 is ongeldig.",
+ "De waarde op regel -1, kolom 19 is ongeldig.",
+ "De waarde op regel -1, kolom 18 is ongeldig.",
+ "De waarde op regel -1, kolom 20 is ongeldig.",
+ "De waarde op regel -1, kolom 19 is ongeldig.",
+ "De waarde op regel -1, kolom 18 is ongeldig.",
+ "De waarde op regel -1, kolom 20 is ongeldig.",
+ "De waarde op regel -1, kolom 18 valt buiten het bereik [0, 1].",
+ "De waarde op regel -1, kolom 18 is ongeldig.",
+ "De waarde op regel -1, kolom 20 is ongeldig.",
+ "De waarde op regel -1, kolom 19 is ongeldig.",
+ "De waarde op regel -1, kolom 18 mag niet nul zijn."
};
CollectionAssert.AreEqual(expectedErrorMessages, validationResult.ErrorMessages);
}
@@ -236,9 +239,9 @@
new StructuresParameterRow
{
ParameterId = "KW_BETSLUIT4",
- NumericalValue = double.PositiveInfinity,
+ NumericalValue = 0,
VarianceValue = 10.0,
- VarianceType = VarianceType.NotSpecified
+ VarianceType = VarianceType.CoefficientOfVariation
},
new StructuresParameterRow
{
@@ -313,30 +316,32 @@
Assert.IsFalse(validationResult.IsValid);
List expectedErrorMessages = new List
{
- "Het kombergend oppervlak van het kunstwerk heeft een ongeldige waarde.",
- "De variantie van de kombergend oppervlak lognormaalverdeling heeft een ongeldige waarde.",
- "De toegestane peilverhoging op het kombergend oppervlak van het kunstwerk heeft een ongeldige waarde.",
- "De variantie van de toegestane peilverhoging op het kombergend oppervlak lognormaalverdeling heeft een ongeldige waarde.",
- "De oriëntatie van het kunstwerk valt buiten het bereik [0, 360].",
- "De breedte van de kruin van het kunstwerk heeft een ongeldige waarde.",
- "De standaard afwijking van de breedte van de kruin normaalverdeling heeft een ongeldige waarde.",
- "De kruinhoogte niet gesloten kering van het kunstwerk heeft een ongeldige waarde.",
- "De standaard afwijking van de kruinhoogte niet gesloten kering normaalverdeling heeft een ongeldige waarde.",
- "De binnenwaterstand van het kunstwerk heeft een ongeldige waarde.",
- "De standaard afwijking van de binnenwaterstand normaalverdeling heeft een ongeldige waarde.",
- "De drempelhoogte van het kunstwerk heeft een ongeldige waarde.",
- "De standaard afwijking van de drempelhoogte normaalverdeling heeft een ongeldige waarde.",
- "Het doorstroomoppervlak van het kunstwerk heeft een ongeldige waarde.",
- "De variantie van het doorstroomoppervlak lognormaalverdeling heeft een ongeldige waarde.",
- "Het kritieke overslagdebiet per strekkende meter van het kunstwerk heeft een ongeldige waarde.",
- "De variantie van de kritieke overslagdebiet per strekkende meter lognormaalverdeling heeft een ongeldige waarde.",
- "De stroomvoerende breedte bij bodembescherming van het kunstwerk heeft een ongeldige waarde.",
- "De variantie van de stroomvoerende breedte bij bodembescherming lognormaalverdeling heeft een ongeldige waarde.",
- "De kans op open staan bij naderend hoogwater heeft een ongeldige waarde.",
- "De kans op mislukken sluiting van geopend kunstwerk heeft een ongeldige waarde.",
- "Het aantal identieke doorstroomopeningen heeft een ongeldige waarde.",
- "De faalkans herstel van gefaalde situatie heeft een ongeldige waarde.",
- "Het instroommodel heeft een ongeldige waarde."
+ "De waarde op regel -1, kolom 18 is ongeldig.",
+ "De waarde op regel -1, kolom 20 is ongeldig.",
+ "De waarde op regel -1, kolom 19 is ongeldig.",
+ "De waarde op regel -1, kolom 18 is ongeldig.",
+ "De waarde op regel -1, kolom 18 valt buiten het bereik [0, 360].",
+ "De waarde op regel -1, kolom 18 mag niet nul zijn.",
+ "De waarde op regel -1, kolom 18 is ongeldig.",
+ "De waarde op regel -1, kolom 20 is ongeldig.",
+ "De waarde op regel -1, kolom 18 is ongeldig.",
+ "De waarde op regel -1, kolom 20 is ongeldig.",
+ "De waarde op regel -1, kolom 18 is ongeldig.",
+ "De waarde op regel -1, kolom 20 is ongeldig.",
+ "De waarde op regel -1, kolom 18 is ongeldig.",
+ "De waarde op regel -1, kolom 20 is ongeldig.",
+ "De waarde op regel -1, kolom 19 is ongeldig.",
+ "De waarde op regel -1, kolom 18 is ongeldig.",
+ "De waarde op regel -1, kolom 20 is ongeldig.",
+ "De waarde op regel -1, kolom 19 is ongeldig.",
+ "De waarde op regel -1, kolom 18 is ongeldig.",
+ "De waarde op regel -1, kolom 20 is ongeldig.",
+ "De waarde op regel -1, kolom 19 is ongeldig.",
+ "De waarde op regel -1, kolom 18 valt buiten het bereik [0, 1].",
+ "De waarde op regel -1, kolom 18 valt buiten het bereik [0, 1].",
+ "De waarde op regel -1, kolom 18 mag niet kleiner dan nul zijn.",
+ "De waarde op regel -1, kolom 18 valt buiten het bereik [0, 1].",
+ "De waarde op regel -1, kolom 18 valt buiten het bereik [0, 2]."
};
CollectionAssert.AreEqual(expectedErrorMessages, validationResult.ErrorMessages);
}
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/ValidationResultTest.cs
===================================================================
diff -u
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/ValidationResultTest.cs (revision 0)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/ValidationResultTest.cs (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -0,0 +1,97 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Collections.Generic;
+using Core.Common.TestUtil;
+using NUnit.Framework;
+using Ringtoets.Common.IO.Structures;
+
+namespace Ringtoets.Common.IO.Test.Structures
+{
+ [TestFixture]
+ public class ValidationResultTest
+ {
+ private List TestMessages()
+ {
+ return new List
+ {
+ "Some text."
+ };
+ }
+
+ [Test]
+ public void Constructor_ErrorMessagesNull_ThrowsArgumentException()
+ {
+ // Call
+ TestDelegate call = () => new ValidationResult(null);
+
+ // Assert
+ string paramName = Assert.Throws(call).ParamName;
+ Assert.AreEqual("errorMessages", paramName);
+ }
+
+ [Test]
+ [TestCase(null)]
+ [TestCase("")]
+ [TestCase(" ")]
+ public void Constructor_ErrorMessagesContainsNullOrWhiteSpace_ThrowsArgumentException(string errormessage)
+ {
+ // Setup
+ List errorMessages = TestMessages();
+ errorMessages.Add(errormessage);
+
+ // Call
+ TestDelegate call = () => new ValidationResult(errorMessages);
+
+ // Assert
+ TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, "Invalid error message string.");
+ }
+
+ [Test]
+ public void Constructor_ErrorMessagesEmpty_ExpectedValues()
+ {
+ // Setup
+ List errorMessages = new List();
+
+ // Call
+ var validationResult = new ValidationResult(errorMessages);
+
+ // Assert
+ Assert.IsTrue(validationResult.IsValid);
+ CollectionAssert.IsEmpty(validationResult.ErrorMessages);
+ }
+
+ [Test]
+ public void Constructor_ErrorMessages_ExpectedValues()
+ {
+ // Setup
+ List errorMessages = TestMessages();
+
+ // Call
+ var validationResult = new ValidationResult(errorMessages);
+
+ // Assert
+ Assert.IsFalse(validationResult.IsValid);
+ CollectionAssert.AreEqual(errorMessages, validationResult.ErrorMessages);
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 2f6400116d57c2b49f7089dbc9c8cd935c185a36 refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.IO.Test/ValidationResultTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 2f6400116d57c2b49f7089dbc9c8cd935c185a36 refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/CorrectShpIcompleteCsv/Kunstwerken.csv'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/CorrectShpIcompleteCsv/Kunstwerken.dbf
===================================================================
diff -u -r83c343bc1fee0c7092c9d9a5ffe36fd9ee6b1aa6 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
Binary files differ
Fisheye: Tag 2f6400116d57c2b49f7089dbc9c8cd935c185a36 refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/CorrectShpIcompleteCsv/Kunstwerken.prj'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/CorrectShpIcompleteCsv/Kunstwerken.shp
===================================================================
diff -u -r83c343bc1fee0c7092c9d9a5ffe36fd9ee6b1aa6 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
Binary files differ
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/CorrectShpIcompleteCsv/Kunstwerken.shx
===================================================================
diff -u -r83c343bc1fee0c7092c9d9a5ffe36fd9ee6b1aa6 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
Binary files differ
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/CorrectShpIncompleteCsv/Kunstwerken.csv
===================================================================
diff -u
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/CorrectShpIncompleteCsv/Kunstwerken.csv (revision 0)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/CorrectShpIncompleteCsv/Kunstwerken.csv (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -0,0 +1,10 @@
+Namespace;Identificatie;Versie;Kunstwerken.identificatie;Parameter.code;Parameter.omschrijving;Grootheid.code;Grootheid.omschrijving;Eenheid.code;Eenheid.omschrijving;Hoedanigheid.code;Hoedanigheid.omschrijving;Waardebepalingsmethode.code;Waardebepalingsmethode.codespace;Waardebewerkingsmethode.code;Waardebewerkingsmethode.codespace;AlphanumeriekeWaarde;NumeriekeWaarde;Standarddeviatie.variance;Boolean;Kwaliteitsoordeel.code
+12;KUNST1;1;KW_HOOGTE1;KUNSTW;Kunstwerk;ORIENTATIE;Ori�ntatie;grad;graden;;;Schematiseringshandleiding;;;;0;-45;0;0;
+12;KUNST1;1;KW_HOOGTE2;KRUIN;Kruin;NIVEAU;Niveau;m;meter;;;Schematiseringshandleiding;;;;;5.9;0.01;1;
+12;KUNST1;1;KW_HOOGTE2;KRUIN;Kruin;NIVEAU;Niveau;m;meter;;;Schematiseringshandleiding;;;;;5.9;0.01;1;
+12;KUNST1;1;KW_HOOGTE3;STROM;Stroming;BREEDTE;Breedte;m;meter;;;Schematiseringshandleiding;;;;;18.5;0.05;1;
+12;KUNST1;1;KW_HOOGTE4;OVS;Overslag;DEBIET;Debiet;m3/s/m;kubieke meter per seconden per meter;;;Schematiseringshandleiding;;;;;0.1;0.15;0;
+12;KUNST1;1;KW_HOOGTE5;KRUIN;Kruin;BREEDTE;Breedte;m;meter;;;Schematiseringshandleiding;;;;;4;0.05;1;
+12;KUNST1;1;KW_HOOGTE6;KUNSTW;Kunstwerk;FAALKANS;Faalkans;;;;;Schematiseringshandleiding;;;;;1;0;0;
+12;KUNST1;1;KW_HOOGTE7;KOMBERG;Komberging;OPPERVLAKTE;Oppervlakte;m2;vierkante meter;;;Schematiseringshandleiding;;;;;500000;0.1;0;
+12;KUNST1;1;KW_HOOGTE8;PEIL;Peil;VERHOGING;Verhoging;m;meter;;;Schematiseringshandleiding;;;;;6.5;0.1;1;
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/CorrectShpIncompleteCsv/Kunstwerken.dbf
===================================================================
diff -u
Binary files differ
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/CorrectShpIncompleteCsv/Kunstwerken.prj
===================================================================
diff -u
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/CorrectShpIncompleteCsv/Kunstwerken.prj (revision 0)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/CorrectShpIncompleteCsv/Kunstwerken.prj (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -0,0 +1 @@
+PROJCS["RD_New",GEOGCS["GCS_Amersfoort",DATUM["D_Amersfoort",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292519943295]],PROJECTION["Double_Stereographic"],PARAMETER["False_Easting",155000.0],PARAMETER["False_Northing",463000.0],PARAMETER["Central_Meridian",5.38763888888889],PARAMETER["Scale_Factor",0.9999079],PARAMETER["Latitude_Of_Origin",52.15616055555555],UNIT["Meter",1.0]]
\ No newline at end of file
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/CorrectShpIncompleteCsv/Kunstwerken.shp
===================================================================
diff -u
Binary files differ
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/Structures/CorrectShpIncompleteCsv/Kunstwerken.shx
===================================================================
diff -u
Binary files differ
Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructure.cs
===================================================================
diff -u -r9050ad5f3a80e630b2fcc092942a40d6343286a0 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructure.cs (.../HeightStructure.cs) (revision 9050ad5f3a80e630b2fcc092942a40d6343286a0)
+++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructure.cs (.../HeightStructure.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -55,6 +55,7 @@
/// Thrown when or is null
/// , empty or consists of whitespace.
/// Thrown when is null.
+ /// Thrown when any parameter is out of range.
public HeightStructure(string name, string id, Point2D location,
double structureNormalOrientation,
double levelCrestStructureMean, double levelCrestStructureStandardDeviation,
Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresContextTreeNodeInfoTest.cs
===================================================================
diff -u -rdd72cf407b7d0e9284d101bb2e2854e569b1a29a -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresContextTreeNodeInfoTest.cs (.../HeightStructuresContextTreeNodeInfoTest.cs) (revision dd72cf407b7d0e9284d101bb2e2854e569b1a29a)
+++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresContextTreeNodeInfoTest.cs (.../HeightStructuresContextTreeNodeInfoTest.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -226,7 +226,7 @@
private static HeightStructure CreateHeightStructure()
{
- var heightStructure = new HeightStructure("aName", "anId", new Point2D(1.22, 2.333),
+ return new HeightStructure("aName", "anId", new Point2D(1.22, 2.333),
0.12345,
234.567, 0.23456,
345.678, 0.34567,
@@ -235,7 +235,6 @@
0.67890,
112.223, 0.11222,
225.336, 0.22533);
- return heightStructure;
}
}
}
\ No newline at end of file
Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/HeightStructuresImporterTest.cs
===================================================================
diff -u -r53ce7ab9ad9a8cf116723e5ddb4108cf655ec955 -r2f6400116d57c2b49f7089dbc9c8cd935c185a36
--- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/HeightStructuresImporterTest.cs (.../HeightStructuresImporterTest.cs) (revision 53ce7ab9ad9a8cf116723e5ddb4108cf655ec955)
+++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/HeightStructuresImporterTest.cs (.../HeightStructuresImporterTest.cs) (revision 2f6400116d57c2b49f7089dbc9c8cd935c185a36)
@@ -61,7 +61,7 @@
}
[Test]
- public void Import_ValidImcompleteFile_LogAndTrue()
+ public void Import_ValidIncompleteFile_LogAndTrue()
{
// Setup
string filePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO,
@@ -107,10 +107,8 @@
{
// Setup
string filePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO,
- Path.Combine("Structures", "CorrectShpIcompleteCsv", "Kunstwerken.shp"));
+ Path.Combine("Structures", "CorrectShpIncompleteCsv", "Kunstwerken.shp"));
- string csvFilePath = Path.ChangeExtension(filePath, ".csv");
-
var referencePoints = new List
{
new Point2D(131144.094, 549979.893),