Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/SurfaceLineEntityReadExtensions.cs =================================================================== diff -u -r3b68b0758709ec06ecc7581f4f852f3cea864c5d -r56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/SurfaceLineEntityReadExtensions.cs (.../SurfaceLineEntityReadExtensions.cs) (revision 3b68b0758709ec06ecc7581f4f852f3cea864c5d) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/SurfaceLineEntityReadExtensions.cs (.../SurfaceLineEntityReadExtensions.cs) (revision 56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8) @@ -21,6 +21,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using Application.Ringtoets.Storage.DbContext; using Application.Ringtoets.Storage.Serializers; using Core.Common.Base.Geometry; @@ -111,7 +112,9 @@ surfaceLine.SetDitchPolderSideAt(geometryPoint); break; default: - throw new NotImplementedException(); + throw new InvalidEnumArgumentException("type", + (int) type, + typeof(CharacteristicPointType)); } } } Index: Core/Common/src/Core.Common.Controls.TreeView/DragDropHandler.cs =================================================================== diff -u -r24da3aa72ccc0776599628c9f971081694048d9a -r56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8 --- Core/Common/src/Core.Common.Controls.TreeView/DragDropHandler.cs (.../DragDropHandler.cs) (revision 24da3aa72ccc0776599628c9f971081694048d9a) +++ Core/Common/src/Core.Common.Controls.TreeView/DragDropHandler.cs (.../DragDropHandler.cs) (revision 56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using FormsTreeView = System.Windows.Forms.TreeView; @@ -394,7 +395,9 @@ yPos = bounds.Top + bounds.Height/2; break; default: - throw new ArgumentOutOfRangeException("location"); + throw new InvalidEnumArgumentException("location", + (int) location, + typeof(PlaceholderLocation)); } return CreateTrianglePoints(new Rectangle(xPos, yPos - placeHolderWidth, placeHolderWidth, placeHolderHeight), anchor); Index: Core/Common/test/Core.Common.TestUtil/LogLevelConstant.cs =================================================================== diff -u -rde4477561032a5d95d5e65e50b719724466648ed -r56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8 --- Core/Common/test/Core.Common.TestUtil/LogLevelConstant.cs (.../LogLevelConstant.cs) (revision de4477561032a5d95d5e65e50b719724466648ed) +++ Core/Common/test/Core.Common.TestUtil/LogLevelConstant.cs (.../LogLevelConstant.cs) (revision 56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8) @@ -19,7 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; +using System.ComponentModel; using log4net.Core; namespace Core.Common.TestUtil @@ -53,7 +53,7 @@ case LogLevelConstant.Debug: return Level.Debug; default: - throw new NotImplementedException(); + throw new InvalidEnumArgumentException("level", (int) level, typeof(LogLevelConstant)); } } } Index: Core/Components/src/Core.Components.DotSpatial/Converter/MapDataHelper.cs =================================================================== diff -u -r151bab16a7ebc1bffc0621ab56c6dc219db1e90f -r56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8 --- Core/Components/src/Core.Components.DotSpatial/Converter/MapDataHelper.cs (.../MapDataHelper.cs) (revision 151bab16a7ebc1bffc0621ab56c6dc219db1e90f) +++ Core/Components/src/Core.Components.DotSpatial/Converter/MapDataHelper.cs (.../MapDataHelper.cs) (revision 56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8) @@ -19,7 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; +using System.ComponentModel; using Core.Components.Gis.Data; using Core.Components.Gis.Style; using DotSpatial.Symbology; @@ -51,7 +51,9 @@ shape = PointShape.Triangle; break; default: - throw new NotSupportedException(); + throw new InvalidEnumArgumentException("symbol", + (int) symbol, + typeof(PointShape)); } return shape; } Index: Core/Components/src/Core.Components.OxyPlot/Converter/ChartDataHelper.cs =================================================================== diff -u -rebbb56ddd6ef8857548dcbbfa51c0650f0207d86 -r56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8 --- Core/Components/src/Core.Components.OxyPlot/Converter/ChartDataHelper.cs (.../ChartDataHelper.cs) (revision ebbb56ddd6ef8857548dcbbfa51c0650f0207d86) +++ Core/Components/src/Core.Components.OxyPlot/Converter/ChartDataHelper.cs (.../ChartDataHelper.cs) (revision 56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using Core.Components.Charting.Data; @@ -60,7 +61,9 @@ lineStyle = LineStyle.DashDotDot; break; default: - throw new NotSupportedException(); + throw new InvalidEnumArgumentException("dashStyle", + (int) dashStyle, + typeof(DashStyle)); } return lineStyle; } @@ -93,7 +96,9 @@ markerType = MarkerType.Triangle; break; default: - throw new NotSupportedException(); + throw new InvalidEnumArgumentException("symbol", + (int) symbol, + typeof(ChartPointSymbol)); } return markerType; } Index: Core/Components/test/Core.Components.OxyPlot.Test/Converter/ChartDataHelperTest.cs =================================================================== diff -u -red96d38a758365e4c0f117def83a2926c589c18a -r56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8 --- Core/Components/test/Core.Components.OxyPlot.Test/Converter/ChartDataHelperTest.cs (.../ChartDataHelperTest.cs) (revision ed96d38a758365e4c0f117def83a2926c589c18a) +++ Core/Components/test/Core.Components.OxyPlot.Test/Converter/ChartDataHelperTest.cs (.../ChartDataHelperTest.cs) (revision 56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8) @@ -19,7 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; +using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using Core.Components.Charting.Styles; @@ -106,13 +106,13 @@ } [Test] - public void Convert_Custom_ThrowsNotSupportedException() + public void Convert_Custom_ThrowsInvalidEnumArgumentException() { // Call TestDelegate call = () => ChartDataHelper.Convert(DashStyle.Custom); // Assert - Assert.Throws(call); + Assert.Throws(call); } #endregion Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Service/ClosingStructuresCalculationService.cs =================================================================== diff -u -rd79d26d2ad423b4287d5cdaeb0ac267089a54bf9 -r56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Service/ClosingStructuresCalculationService.cs (.../ClosingStructuresCalculationService.cs) (revision d79d26d2ad423b4287d5cdaeb0ac267089a54bf9) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Service/ClosingStructuresCalculationService.cs (.../ClosingStructuresCalculationService.cs) (revision 56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8) @@ -273,7 +273,7 @@ if (inputParameters.Structure == null) { - validationResults.Add("Er is geen kunstwerk sluiten geselecteerd."); + validationResults.Add(RingtoetsCommonServiceResources.StructuresCalculationService_ValidateInput_No_Structure_selected); } else { Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Service.Test/ClosingStructuresCalculationServiceTest.cs =================================================================== diff -u -r52984acfeadfaabc351703a0d03e0564c8256cd5 -r56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Service.Test/ClosingStructuresCalculationServiceTest.cs (.../ClosingStructuresCalculationServiceTest.cs) (revision 52984acfeadfaabc351703a0d03e0564c8256cd5) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Service.Test/ClosingStructuresCalculationServiceTest.cs (.../ClosingStructuresCalculationServiceTest.cs) (revision 56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using System.Collections.Generic; using System.ComponentModel; using System.IO; using System.Linq; @@ -52,65 +51,13 @@ private static readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); private static readonly string validDataFilepath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); - #region Parameter name mappings - - private static readonly Dictionary parameterNames = new Dictionary() - { - { - "insideWaterLevel", "binnenwaterstand" - }, - { - "stormDuration", "stormduur" - }, - { - "deviationWaveDirection", "afwijking golfrichting" - }, - { - "factorStormDurationOpenStructure", "factor voor stormduur hoogwater" - }, - { - "modelFactorSuperCriticalFlow", "modelfactor overloopdebiet volkomen overlaat" - }, - { - "drainCoefficient", "afvoercoëfficient" - }, - { - "structureNormalOrientation", "oriëntatie" - }, - { - "thresholdHeightOpenWeir", "drempelhoogte" - }, - { - "areaFlowApertures", "doorstroomoppervlak" - }, - { - "levelCrestStructureNotClosing", "kruinhoogte niet gesloten kering" - }, - { - "allowedLevelIncreaseStorage", "toegestane peilverhoging komberging" - }, - { - "storageStructureArea", "kombergend oppervlak" - }, - { - "flowWidthAtBottomProtection", "stroomvoerende breedte bodembescherming" - }, - { - "criticalOvertoppingDischarge", "kritiek instromend debiet" - }, - { - "widthFlowApertures", "breedte van doorstroomopening" - } - }; - - #endregion - [Test] public void Validate_ValidCalculationInvalidHydraulicBoundaryDatabase_ReturnsFalse() { // Setup var mockRepository = new MockRepository(); - var assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(new ClosingStructuresFailureMechanism(), mockRepository); + IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(new ClosingStructuresFailureMechanism(), + mockRepository); mockRepository.ReplayAll(); assessmentSectionStub.HydraulicBoundaryDatabase.FilePath = Path.Combine(testDataPath, "notexisting.sqlite"); @@ -150,14 +97,15 @@ { // Setup var mockRepository = new MockRepository(); - var assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(new ClosingStructuresFailureMechanism(), mockRepository); + IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(new ClosingStructuresFailureMechanism(), + mockRepository); mockRepository.ReplayAll(); assessmentSectionStub.HydraulicBoundaryDatabase.FilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); const string name = ""; - var calculation = new TestClosingStructuresCalculation() + var calculation = new TestClosingStructuresCalculation { Name = name, InputParameters = @@ -190,14 +138,15 @@ { // Setup var mockRepository = new MockRepository(); - var assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(new ClosingStructuresFailureMechanism(), mockRepository); + IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(new ClosingStructuresFailureMechanism(), + mockRepository); mockRepository.ReplayAll(); assessmentSectionStub.HydraulicBoundaryDatabase.FilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); const string name = ""; - var calculation = new TestClosingStructuresCalculation() + var calculation = new TestClosingStructuresCalculation { Name = name, InputParameters = @@ -217,7 +166,7 @@ var msgs = messages.ToArray(); Assert.AreEqual(3, msgs.Length); StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", name), msgs[0]); - StringAssert.StartsWith("Validatie mislukt: Er is geen kunstwerk sluiten geselecteerd.", msgs[1]); + StringAssert.StartsWith("Validatie mislukt: Er is geen kunstwerk geselecteerd.", msgs[1]); StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", name), msgs[2]); }); Assert.IsFalse(isValid); @@ -233,19 +182,20 @@ { // Setup var mockRepository = new MockRepository(); - var assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(new ClosingStructuresFailureMechanism(), mockRepository); + IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(new ClosingStructuresFailureMechanism(), + mockRepository); mockRepository.ReplayAll(); assessmentSectionStub.HydraulicBoundaryDatabase.FilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); const string name = ""; - var calculation = new TestClosingStructuresCalculation() + var calculation = new TestClosingStructuresCalculation { Name = name }; - SetInvalidInputParameters(calculation, (RoundedDouble) value); + SetInvalidInputParameters(calculation.InputParameters, (RoundedDouble) value); // Call bool isValid = false; @@ -257,25 +207,25 @@ var msgs = messages.ToArray(); Assert.AreEqual(21, msgs.Length); StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", name), msgs[0]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", parameterNames["stormDuration"]), msgs[1]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["stormDuration"]), msgs[2]); - StringAssert.StartsWith(string.Format("Validatie mislukt: Er is geen concreet getal ingevoerd voor '{0}'.", parameterNames["deviationWaveDirection"]), msgs[3]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", parameterNames["modelFactorSuperCriticalFlow"]), msgs[4]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["modelFactorSuperCriticalFlow"]), msgs[5]); - StringAssert.StartsWith(string.Format("Validatie mislukt: Er is geen concreet getal ingevoerd voor '{0}'.", parameterNames["factorStormDurationOpenStructure"]), msgs[6]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", parameterNames["widthFlowApertures"]), msgs[7]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["widthFlowApertures"]), msgs[8]); - StringAssert.StartsWith(string.Format("Validatie mislukt: Er is geen concreet getal ingevoerd voor '{0}'.", parameterNames["structureNormalOrientation"]), msgs[9]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", parameterNames["flowWidthAtBottomProtection"]), msgs[10]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["flowWidthAtBottomProtection"]), msgs[11]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", parameterNames["storageStructureArea"]), msgs[12]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["storageStructureArea"]), msgs[13]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", parameterNames["allowedLevelIncreaseStorage"]), msgs[14]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["allowedLevelIncreaseStorage"]), msgs[15]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", parameterNames["levelCrestStructureNotClosing"]), msgs[16]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["levelCrestStructureNotClosing"]), msgs[17]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", parameterNames["criticalOvertoppingDischarge"]), msgs[18]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["criticalOvertoppingDischarge"]), msgs[19]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", stormDuration), msgs[1]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", stormDuration), msgs[2]); + StringAssert.StartsWith(string.Format("Validatie mislukt: Er is geen concreet getal ingevoerd voor '{0}'.", deviationWaveDirection), msgs[3]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", modelFactorSuperCriticalFlow), msgs[4]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", modelFactorSuperCriticalFlow), msgs[5]); + StringAssert.StartsWith(string.Format("Validatie mislukt: Er is geen concreet getal ingevoerd voor '{0}'.", factorStormDurationOpenStructure), msgs[6]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", widthFlowApertures), msgs[7]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", widthFlowApertures), msgs[8]); + StringAssert.StartsWith(string.Format("Validatie mislukt: Er is geen concreet getal ingevoerd voor '{0}'.", structureNormalOrientation), msgs[9]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", flowWidthAtBottomProtection), msgs[10]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", flowWidthAtBottomProtection), msgs[11]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", storageStructureArea), msgs[12]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", storageStructureArea), msgs[13]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", allowedLevelIncreaseStorage), msgs[14]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", allowedLevelIncreaseStorage), msgs[15]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", levelCrestStructureNotClosing), msgs[16]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", levelCrestStructureNotClosing), msgs[17]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", criticalOvertoppingDischarge), msgs[18]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", criticalOvertoppingDischarge), msgs[19]); StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", name), msgs[20]); }); Assert.IsFalse(isValid); @@ -291,22 +241,23 @@ { // Setup var mockRepository = new MockRepository(); - var assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(new ClosingStructuresFailureMechanism(), mockRepository); + IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(new ClosingStructuresFailureMechanism(), + mockRepository); mockRepository.ReplayAll(); assessmentSectionStub.HydraulicBoundaryDatabase.FilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); const string name = ""; - var calculation = new TestClosingStructuresCalculation() + var calculation = new TestClosingStructuresCalculation { Name = name, InputParameters = { InflowModelType = ClosingStructureInflowModelType.LowSill } }; - SetInvalidInputParameters(calculation, (RoundedDouble) value); + SetInvalidInputParameters(calculation.InputParameters, (RoundedDouble) value); bool isValid = false; @@ -319,25 +270,25 @@ var msgs = messages.ToArray(); Assert.AreEqual(21, msgs.Length); StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", name), msgs[0]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", parameterNames["stormDuration"]), msgs[1]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["stormDuration"]), msgs[2]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", parameterNames["insideWaterLevel"]), msgs[3]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["insideWaterLevel"]), msgs[4]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", parameterNames["modelFactorSuperCriticalFlow"]), msgs[5]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["modelFactorSuperCriticalFlow"]), msgs[6]); - StringAssert.StartsWith(string.Format("Validatie mislukt: Er is geen concreet getal ingevoerd voor '{0}'.", parameterNames["factorStormDurationOpenStructure"]), msgs[7]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", parameterNames["widthFlowApertures"]), msgs[8]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["widthFlowApertures"]), msgs[9]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", parameterNames["flowWidthAtBottomProtection"]), msgs[10]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["flowWidthAtBottomProtection"]), msgs[11]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", parameterNames["storageStructureArea"]), msgs[12]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["storageStructureArea"]), msgs[13]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", parameterNames["allowedLevelIncreaseStorage"]), msgs[14]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["allowedLevelIncreaseStorage"]), msgs[15]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", parameterNames["thresholdHeightOpenWeir"]), msgs[16]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["thresholdHeightOpenWeir"]), msgs[17]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", parameterNames["criticalOvertoppingDischarge"]), msgs[18]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["criticalOvertoppingDischarge"]), msgs[19]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", stormDuration), msgs[1]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", stormDuration), msgs[2]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", insideWaterLevel), msgs[3]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", insideWaterLevel), msgs[4]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", modelFactorSuperCriticalFlow), msgs[5]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", modelFactorSuperCriticalFlow), msgs[6]); + StringAssert.StartsWith(string.Format("Validatie mislukt: Er is geen concreet getal ingevoerd voor '{0}'.", factorStormDurationOpenStructure), msgs[7]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", widthFlowApertures), msgs[8]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", widthFlowApertures), msgs[9]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", flowWidthAtBottomProtection), msgs[10]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", flowWidthAtBottomProtection), msgs[11]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", storageStructureArea), msgs[12]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", storageStructureArea), msgs[13]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", allowedLevelIncreaseStorage), msgs[14]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", allowedLevelIncreaseStorage), msgs[15]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", thresholdHeightOpenWeir), msgs[16]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", thresholdHeightOpenWeir), msgs[17]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", criticalOvertoppingDischarge), msgs[18]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", criticalOvertoppingDischarge), msgs[19]); StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", name), msgs[20]); }); Assert.IsFalse(isValid); @@ -353,22 +304,23 @@ { // Setup var mockRepository = new MockRepository(); - var assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(new ClosingStructuresFailureMechanism(), mockRepository); + IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(new ClosingStructuresFailureMechanism(), + mockRepository); mockRepository.ReplayAll(); assessmentSectionStub.HydraulicBoundaryDatabase.FilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); const string name = ""; - var calculation = new TestClosingStructuresCalculation() + var calculation = new TestClosingStructuresCalculation { Name = name, InputParameters = { InflowModelType = ClosingStructureInflowModelType.FloodedCulvert } }; - SetInvalidInputParameters(calculation, (RoundedDouble) value); + SetInvalidInputParameters(calculation.InputParameters, (RoundedDouble) value); bool isValid = false; @@ -381,23 +333,23 @@ var msgs = messages.ToArray(); Assert.AreEqual(19, msgs.Length); StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", name), msgs[0]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", parameterNames["stormDuration"]), msgs[1]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["stormDuration"]), msgs[2]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", parameterNames["insideWaterLevel"]), msgs[3]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["insideWaterLevel"]), msgs[4]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", parameterNames["drainCoefficient"]), msgs[5]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["drainCoefficient"]), msgs[6]); - StringAssert.StartsWith(string.Format("Validatie mislukt: Er is geen concreet getal ingevoerd voor '{0}'.", parameterNames["factorStormDurationOpenStructure"]), msgs[7]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", parameterNames["areaFlowApertures"]), msgs[8]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["areaFlowApertures"]), msgs[9]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", parameterNames["flowWidthAtBottomProtection"]), msgs[10]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["flowWidthAtBottomProtection"]), msgs[11]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", parameterNames["storageStructureArea"]), msgs[12]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["storageStructureArea"]), msgs[13]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", parameterNames["allowedLevelIncreaseStorage"]), msgs[14]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["allowedLevelIncreaseStorage"]), msgs[15]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", parameterNames["criticalOvertoppingDischarge"]), msgs[16]); - StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", parameterNames["criticalOvertoppingDischarge"]), msgs[17]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", stormDuration), msgs[1]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", stormDuration), msgs[2]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", insideWaterLevel), msgs[3]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", insideWaterLevel), msgs[4]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een concreet getal zijn.", drainCoefficient), msgs[5]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", drainCoefficient), msgs[6]); + StringAssert.StartsWith(string.Format("Validatie mislukt: Er is geen concreet getal ingevoerd voor '{0}'.", factorStormDurationOpenStructure), msgs[7]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", areaFlowApertures), msgs[8]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", areaFlowApertures), msgs[9]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", flowWidthAtBottomProtection), msgs[10]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", flowWidthAtBottomProtection), msgs[11]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", storageStructureArea), msgs[12]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", storageStructureArea), msgs[13]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", allowedLevelIncreaseStorage), msgs[14]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", allowedLevelIncreaseStorage), msgs[15]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De verwachtingswaarde voor '{0}' moet een positief getal zijn.", criticalOvertoppingDischarge), msgs[16]); + StringAssert.StartsWith(string.Format("Validatie mislukt: De variatiecoëfficient voor '{0}' moet groter zijn dan of gelijk zijn aan 0.", criticalOvertoppingDischarge), msgs[17]); StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", name), msgs[18]); }); Assert.IsFalse(isValid); @@ -410,14 +362,15 @@ { // Setup var mockRepository = new MockRepository(); - var assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(new ClosingStructuresFailureMechanism(), mockRepository); + IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(new ClosingStructuresFailureMechanism(), + mockRepository); mockRepository.ReplayAll(); assessmentSectionStub.HydraulicBoundaryDatabase.FilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); const string name = ""; - var calculation = new TestClosingStructuresCalculation() + var calculation = new TestClosingStructuresCalculation { Name = name, InputParameters = @@ -433,7 +386,8 @@ // Assert var exception = Assert.Throws(call); Assert.AreEqual("inputParameters", exception.ParamName); - StringAssert.StartsWith("The value of argument 'inputParameters' (9001) is invalid for Enum type 'ClosingStructureInflowModelType'.", exception.Message); + StringAssert.StartsWith("The value of argument 'inputParameters' (9001) is invalid for Enum type 'ClosingStructureInflowModelType'.", + exception.Message); Assert.IsFalse(isValid); mockRepository.VerifyAll(); } @@ -479,9 +433,10 @@ // Assert Assert.AreEqual(0, calculationInputs.Length); - var exception = Assert.Throws(call); - Assert.AreEqual("calculation", exception.ParamName); - StringAssert.StartsWith("The value of argument 'calculation' (100) is invalid for Enum type 'ClosingStructureInflowModelType'.", exception.Message); + const string expectedMessage = "The value of argument 'calculation' (100) is invalid for Enum type 'ClosingStructureInflowModelType'."; + string paramName = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, + expectedMessage).ParamName; + Assert.AreEqual("calculation", paramName); } mockRepository.VerifyAll(); } @@ -496,7 +451,8 @@ var closingStructuresFailureMechanism = new ClosingStructuresFailureMechanism(); var mockRepository = new MockRepository(); - var assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(closingStructuresFailureMechanism, mockRepository); + IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(closingStructuresFailureMechanism, + mockRepository); mockRepository.ReplayAll(); closingStructuresFailureMechanism.AddSection(new FailureMechanismSection("test section", new[] @@ -588,7 +544,8 @@ var closingStructuresFailureMechanism = new ClosingStructuresFailureMechanism(); var mockRepository = new MockRepository(); - var assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(closingStructuresFailureMechanism, mockRepository); + IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(closingStructuresFailureMechanism, + mockRepository); mockRepository.ReplayAll(); closingStructuresFailureMechanism.AddSection(new FailureMechanismSection("test section", new[] @@ -597,7 +554,7 @@ new Point2D(1, 1) })); - var calculation = new TestClosingStructuresCalculation() + var calculation = new TestClosingStructuresCalculation { InputParameters = { @@ -680,7 +637,8 @@ var closingStructuresFailureMechanism = new ClosingStructuresFailureMechanism(); var mockRepository = new MockRepository(); - var assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(closingStructuresFailureMechanism, mockRepository); + IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(closingStructuresFailureMechanism, + mockRepository); mockRepository.ReplayAll(); closingStructuresFailureMechanism.AddSection(new FailureMechanismSection("test section", new[] @@ -689,7 +647,7 @@ new Point2D(1, 1) })); - var calculation = new TestClosingStructuresCalculation() + var calculation = new TestClosingStructuresCalculation { InputParameters = { @@ -770,7 +728,8 @@ var closingStructuresFailureMechanism = new ClosingStructuresFailureMechanism(); var mockRepository = new MockRepository(); - var assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(closingStructuresFailureMechanism, mockRepository); + IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(closingStructuresFailureMechanism, + mockRepository); mockRepository.ReplayAll(); closingStructuresFailureMechanism.AddSection(new FailureMechanismSection("test section", new[] @@ -818,7 +777,8 @@ var closingStructuresFailureMechanism = new ClosingStructuresFailureMechanism(); var mockRepository = new MockRepository(); - var assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(closingStructuresFailureMechanism, mockRepository); + IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(closingStructuresFailureMechanism, + mockRepository); mockRepository.ReplayAll(); closingStructuresFailureMechanism.AddSection(new FailureMechanismSection("test section", new[] @@ -827,7 +787,7 @@ new Point2D(1, 1) })); - var calculation = new TestClosingStructuresCalculation() + var calculation = new TestClosingStructuresCalculation { InputParameters = { @@ -876,7 +836,8 @@ var closingStructuresFailureMechanism = new ClosingStructuresFailureMechanism(); var mockRepository = new MockRepository(); - var assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(closingStructuresFailureMechanism, mockRepository); + IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub(closingStructuresFailureMechanism, + mockRepository); mockRepository.ReplayAll(); closingStructuresFailureMechanism.AddSection(new FailureMechanismSection("test section", new[] @@ -885,7 +846,7 @@ new Point2D(1, 1) })); - var calculation = new TestClosingStructuresCalculation() + var calculation = new TestClosingStructuresCalculation { InputParameters = { @@ -911,60 +872,87 @@ } } - private static void SetInvalidInputParameters(StructuresCalculation input, RoundedDouble value) + /// + /// Sets all input parameters of to invalid values. + /// + /// The input to be updated. + /// The invalid value to be set on all input properties. + /// If cannot be set on an input property, that + /// value is set to . + private static void SetInvalidInputParameters(ClosingStructuresInput input, RoundedDouble value) { - input.InputParameters.DeviationWaveDirection = RoundedDouble.NaN; - input.InputParameters.DrainCoefficient.Mean = value; - input.InputParameters.FactorStormDurationOpenStructure = value; - input.InputParameters.InsideWaterLevel.Mean = value; - input.InputParameters.LevelCrestStructureNotClosing.Mean = value; - input.InputParameters.ModelFactorSuperCriticalFlow.Mean = value; - input.InputParameters.StructureNormalOrientation = RoundedDouble.NaN; - input.InputParameters.ThresholdHeightOpenWeir.Mean = value; - input.InputParameters.WidthFlowApertures.Mean = value; + input.DeviationWaveDirection = RoundedDouble.NaN; + input.DrainCoefficient.Mean = value; + input.FactorStormDurationOpenStructure = value; + input.InsideWaterLevel.Mean = value; + input.LevelCrestStructureNotClosing.Mean = value; + input.ModelFactorSuperCriticalFlow.Mean = value; + input.StructureNormalOrientation = RoundedDouble.NaN; + input.ThresholdHeightOpenWeir.Mean = value; + input.WidthFlowApertures.Mean = value; if (double.IsNegativeInfinity(value)) { - input.InputParameters.AllowedLevelIncreaseStorage.Mean = RoundedDouble.NaN; - input.InputParameters.AllowedLevelIncreaseStorage.StandardDeviation = RoundedDouble.NaN; - input.InputParameters.AreaFlowApertures.Mean = RoundedDouble.NaN; - input.InputParameters.AreaFlowApertures.StandardDeviation = RoundedDouble.NaN; - input.InputParameters.CriticalOvertoppingDischarge.Mean = RoundedDouble.NaN; - input.InputParameters.CriticalOvertoppingDischarge.CoefficientOfVariation = RoundedDouble.NaN; - input.InputParameters.DrainCoefficient.StandardDeviation = RoundedDouble.NaN; - input.InputParameters.FlowWidthAtBottomProtection.Mean = RoundedDouble.NaN; - input.InputParameters.FlowWidthAtBottomProtection.StandardDeviation = RoundedDouble.NaN; - input.InputParameters.InsideWaterLevel.StandardDeviation = RoundedDouble.NaN; - input.InputParameters.LevelCrestStructureNotClosing.StandardDeviation = RoundedDouble.NaN; - input.InputParameters.ModelFactorSuperCriticalFlow.StandardDeviation = RoundedDouble.NaN; - input.InputParameters.StorageStructureArea.Mean = RoundedDouble.NaN; - input.InputParameters.StorageStructureArea.CoefficientOfVariation = RoundedDouble.NaN; - input.InputParameters.StormDuration.Mean = RoundedDouble.NaN; - input.InputParameters.StormDuration.CoefficientOfVariation = RoundedDouble.NaN; - input.InputParameters.ThresholdHeightOpenWeir.StandardDeviation = RoundedDouble.NaN; - input.InputParameters.WidthFlowApertures.CoefficientOfVariation = RoundedDouble.NaN; + input.AllowedLevelIncreaseStorage.Mean = RoundedDouble.NaN; + input.AllowedLevelIncreaseStorage.StandardDeviation = RoundedDouble.NaN; + input.AreaFlowApertures.Mean = RoundedDouble.NaN; + input.AreaFlowApertures.StandardDeviation = RoundedDouble.NaN; + input.CriticalOvertoppingDischarge.Mean = RoundedDouble.NaN; + input.CriticalOvertoppingDischarge.CoefficientOfVariation = RoundedDouble.NaN; + input.DrainCoefficient.StandardDeviation = RoundedDouble.NaN; + input.FlowWidthAtBottomProtection.Mean = RoundedDouble.NaN; + input.FlowWidthAtBottomProtection.StandardDeviation = RoundedDouble.NaN; + input.InsideWaterLevel.StandardDeviation = RoundedDouble.NaN; + input.LevelCrestStructureNotClosing.StandardDeviation = RoundedDouble.NaN; + input.ModelFactorSuperCriticalFlow.StandardDeviation = RoundedDouble.NaN; + input.StorageStructureArea.Mean = RoundedDouble.NaN; + input.StorageStructureArea.CoefficientOfVariation = RoundedDouble.NaN; + input.StormDuration.Mean = RoundedDouble.NaN; + input.StormDuration.CoefficientOfVariation = RoundedDouble.NaN; + input.ThresholdHeightOpenWeir.StandardDeviation = RoundedDouble.NaN; + input.WidthFlowApertures.CoefficientOfVariation = RoundedDouble.NaN; } else { - input.InputParameters.AllowedLevelIncreaseStorage.Mean = value; - input.InputParameters.AllowedLevelIncreaseStorage.StandardDeviation = value; - input.InputParameters.AreaFlowApertures.Mean = value; - input.InputParameters.AreaFlowApertures.StandardDeviation = value; - input.InputParameters.CriticalOvertoppingDischarge.Mean = value; - input.InputParameters.CriticalOvertoppingDischarge.CoefficientOfVariation = value; - input.InputParameters.DrainCoefficient.StandardDeviation = value; - input.InputParameters.FlowWidthAtBottomProtection.Mean = value; - input.InputParameters.FlowWidthAtBottomProtection.StandardDeviation = value; - input.InputParameters.InsideWaterLevel.StandardDeviation = value; - input.InputParameters.LevelCrestStructureNotClosing.StandardDeviation = value; - input.InputParameters.ModelFactorSuperCriticalFlow.StandardDeviation = value; - input.InputParameters.StorageStructureArea.Mean = value; - input.InputParameters.StorageStructureArea.CoefficientOfVariation = value; - input.InputParameters.StormDuration.Mean = value; - input.InputParameters.StormDuration.CoefficientOfVariation = value; - input.InputParameters.ThresholdHeightOpenWeir.StandardDeviation = value; - input.InputParameters.WidthFlowApertures.CoefficientOfVariation = value; + input.AllowedLevelIncreaseStorage.Mean = value; + input.AllowedLevelIncreaseStorage.StandardDeviation = value; + input.AreaFlowApertures.Mean = value; + input.AreaFlowApertures.StandardDeviation = value; + input.CriticalOvertoppingDischarge.Mean = value; + input.CriticalOvertoppingDischarge.CoefficientOfVariation = value; + input.DrainCoefficient.StandardDeviation = value; + input.FlowWidthAtBottomProtection.Mean = value; + input.FlowWidthAtBottomProtection.StandardDeviation = value; + input.InsideWaterLevel.StandardDeviation = value; + input.LevelCrestStructureNotClosing.StandardDeviation = value; + input.ModelFactorSuperCriticalFlow.StandardDeviation = value; + input.StorageStructureArea.Mean = value; + input.StorageStructureArea.CoefficientOfVariation = value; + input.StormDuration.Mean = value; + input.StormDuration.CoefficientOfVariation = value; + input.ThresholdHeightOpenWeir.StandardDeviation = value; + input.WidthFlowApertures.CoefficientOfVariation = value; } } + + #region Parameter name mappings + + private const string insideWaterLevel = "binnenwaterstand"; + private const string stormDuration = "stormduur"; + private const string deviationWaveDirection = "afwijking golfrichting"; + private const string factorStormDurationOpenStructure = "factor voor stormduur hoogwater"; + private const string modelFactorSuperCriticalFlow = "modelfactor overloopdebiet volkomen overlaat"; + private const string drainCoefficient = "afvoercoëfficient"; + private const string structureNormalOrientation = "oriëntatie"; + private const string thresholdHeightOpenWeir = "drempelhoogte"; + private const string areaFlowApertures = "doorstroomoppervlak"; + private const string levelCrestStructureNotClosing = "kruinhoogte niet gesloten kering"; + private const string allowedLevelIncreaseStorage = "toegestane peilverhoging komberging"; + private const string storageStructureArea = "kombergend oppervlak"; + private const string flowWidthAtBottomProtection = "stroomvoerende breedte bodembescherming"; + private const string criticalOvertoppingDischarge = "kritiek instromend debiet"; + private const string widthFlowApertures = "breedte van doorstroomopening"; + + #endregion } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresParameterRowsValidator.cs =================================================================== diff -u -r723c48084f30ec6a930a9ef16cf1a657e9eeec65 -r56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8 --- Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresParameterRowsValidator.cs (.../StructuresParameterRowsValidator.cs) (revision 723c48084f30ec6a930a9ef16cf1a657e9eeec65) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresParameterRowsValidator.cs (.../StructuresParameterRowsValidator.cs) (revision 56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8) @@ -325,7 +325,7 @@ case StructureFilesKeywords.VariationValueColumnName: return row.VarianceValue; default: - throw new NotImplementedException(); + throw new NotSupportedException(); } } Index: Ringtoets/Common/src/Ringtoets.Common.Service/Properties/Resources.Designer.cs =================================================================== diff -u -rcc39748cdc122bfcc9bfb27e6e1ac9b7c558b5bf -r56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8 --- Ringtoets/Common/src/Ringtoets.Common.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision cc39748cdc122bfcc9bfb27e6e1ac9b7c558b5bf) +++ Ringtoets/Common/src/Ringtoets.Common.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8) @@ -22,7 +22,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Runtime Version:4.0.30319.18444 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -217,20 +217,20 @@ } /// - /// Looks up a localized string similar to Er is geen kunstwerk geselecteerd.. + /// Looks up a localized string similar to Herstellen van de verbinding met de hydraulische randvoorwaardendatabase is mislukt. {0}. /// - public static string HeightStructuresCalculationService_ValidateInput_No_Structure_selected { + public static string Hydraulic_boundary_database_connection_failed_0_ { get { - return ResourceManager.GetString("HeightStructuresCalculationService_ValidateInput_No_Structure_selected", resourceCulture); + return ResourceManager.GetString("Hydraulic_boundary_database_connection_failed_0_", resourceCulture); } } /// - /// Looks up a localized string similar to Herstellen van de verbinding met de hydraulische randvoorwaardendatabase is mislukt. {0}. + /// Looks up a localized string similar to Er is geen kunstwerk geselecteerd.. /// - public static string Hydraulic_boundary_database_connection_failed_0_ { + public static string StructuresCalculationService_ValidateInput_No_Structure_selected { get { - return ResourceManager.GetString("Hydraulic_boundary_database_connection_failed_0_", resourceCulture); + return ResourceManager.GetString("StructuresCalculationService_ValidateInput_No_Structure_selected", resourceCulture); } } Index: Ringtoets/Common/src/Ringtoets.Common.Service/Properties/Resources.resx =================================================================== diff -u -rcc39748cdc122bfcc9bfb27e6e1ac9b7c558b5bf -r56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8 --- Ringtoets/Common/src/Ringtoets.Common.Service/Properties/Resources.resx (.../Resources.resx) (revision cc39748cdc122bfcc9bfb27e6e1ac9b7c558b5bf) +++ Ringtoets/Common/src/Ringtoets.Common.Service/Properties/Resources.resx (.../Resources.resx) (revision 56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8) @@ -177,7 +177,7 @@ De standaard afwijking voor '{0}' moet groter zijn dan of gelijk zijn aan 0. - + Er is geen kunstwerk geselecteerd. Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/HeightStructuresCalculationService.cs =================================================================== diff -u -rcfe7c2c39dcb9e0a25af2908650c7191a733f4e2 -r56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/HeightStructuresCalculationService.cs (.../HeightStructuresCalculationService.cs) (revision cfe7c2c39dcb9e0a25af2908650c7191a733f4e2) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/HeightStructuresCalculationService.cs (.../HeightStructuresCalculationService.cs) (revision 56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8) @@ -180,7 +180,7 @@ if (inputParameters.Structure == null) { - validationResults.Add(RingtoetsCommonServiceResources.HeightStructuresCalculationService_ValidateInput_No_Structure_selected); + validationResults.Add(RingtoetsCommonServiceResources.StructuresCalculationService_ValidateInput_No_Structure_selected); } else { Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs =================================================================== diff -u -rae14c5d4e4624fa87390e6d63bb419c648e12dda -r56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs (.../AssessmentSection.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs (.../AssessmentSection.cs) (revision 56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8) @@ -21,6 +21,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using Core.Common.Base; using Core.Common.Base.Geometry; using Ringtoets.ClosingStructures.Data; @@ -267,7 +268,9 @@ FailureMechanismContribution.UpdateContributions(GetContributingFailureMechanisms(), 20); break; default: - throw new NotImplementedException(); + throw new InvalidEnumArgumentException("newComposition", + (int) newComposition, + typeof(AssessmentSectionComposition)); } Composition = newComposition; } Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -r1a49563c568eaef8b84743fec1f04ee119bf5c9c -r56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 1a49563c568eaef8b84743fec1f04ee119bf5c9c) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8) @@ -22,6 +22,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.ComponentModel; using System.Drawing; using System.Linq; using System.Windows.Forms; @@ -1126,7 +1127,9 @@ case TreeFolderCategory.Output: return RingtoetsCommonFormsResources.OutputFolderIcon; default: - throw new NotImplementedException(); + throw new InvalidEnumArgumentException("category", + (int) category, + typeof(TreeFolderCategory)); } } Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanismSection2aAssessmentResultExtensions.cs =================================================================== diff -u -r06abcaadc2936c0bf3fde73916c051f37f698505 -r56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8 --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanismSection2aAssessmentResultExtensions.cs (.../PipingFailureMechanismSection2aAssessmentResultExtensions.cs) (revision 06abcaadc2936c0bf3fde73916c051f37f698505) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanismSection2aAssessmentResultExtensions.cs (.../PipingFailureMechanismSection2aAssessmentResultExtensions.cs) (revision 56ec7114c4c96eeee4a1bb16d0ecac2bb10a49b8) @@ -19,8 +19,8 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using Core.Common.Base.Data; using Core.Common.Base.Geometry; @@ -97,7 +97,9 @@ case CalculationScenarioStatus.Done: continue; default: - throw new ArgumentOutOfRangeException(); + throw new InvalidEnumArgumentException("pipingFailureMechanismSectionResult", + (int) calculationScenario.Status, + typeof(CalculationScenarioStatus)); } }