Index: Core/Common/test/Core.Common.Geometry.Test/AdvancedMath2DTest.cs =================================================================== diff -u -r8c1fffbb415e7c2470be6d3fa2971103777d418e -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Core/Common/test/Core.Common.Geometry.Test/AdvancedMath2DTest.cs (.../AdvancedMath2DTest.cs) (revision 8c1fffbb415e7c2470be6d3fa2971103777d418e) +++ Core/Common/test/Core.Common.Geometry.Test/AdvancedMath2DTest.cs (.../AdvancedMath2DTest.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -262,7 +262,7 @@ TestDelegate test = () => AdvancedMath2D.FromXToXY(null, new Point2D(0, 0), 3, 2); // Assert - var paramName = TestHelper.AssertThrowsArgumentExceptionAndTestMessage( + string paramName = TestHelper.AssertThrowsArgumentExceptionAndTestMessage( test, "Cannot transform to coordinates without a source.").ParamName; Assert.AreEqual("xCoordinates", paramName); @@ -275,7 +275,7 @@ TestDelegate test = () => AdvancedMath2D.FromXToXY(new double[0], null, 3, 2); // Assert - var paramName = TestHelper.AssertThrowsArgumentExceptionAndTestMessage( + string paramName = TestHelper.AssertThrowsArgumentExceptionAndTestMessage( test, "Cannot transform to coordinates without a reference point.").ParamName; Assert.AreEqual("referencePoint", paramName); Index: Core/Common/test/Core.Common.IO.Test/Readers/IDataReaderExtensionsTest.cs =================================================================== diff -u -r545b105a213ed85564861b4bcf6d2d6425dbde50 -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Core/Common/test/Core.Common.IO.Test/Readers/IDataReaderExtensionsTest.cs (.../IDataReaderExtensionsTest.cs) (revision 545b105a213ed85564861b4bcf6d2d6425dbde50) +++ Core/Common/test/Core.Common.IO.Test/Readers/IDataReaderExtensionsTest.cs (.../IDataReaderExtensionsTest.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -78,7 +78,7 @@ // Assert ArgumentException exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage( test, "Column \'SomeColumn\' not defined for data row."); - var paramName = exception.ParamName; + string paramName = exception.ParamName; Assert.AreEqual("columnName", paramName); mockRepository.VerifyAll(); Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PropertyClasses/ClosingStructuresFailureMechanismProperties.cs =================================================================== diff -u -re2f91813f3aae8eb2daef6ff1ffac61d197148a8 -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PropertyClasses/ClosingStructuresFailureMechanismProperties.cs (.../ClosingStructuresFailureMechanismProperties.cs) (revision e2f91813f3aae8eb2daef6ff1ffac61d197148a8) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PropertyClasses/ClosingStructuresFailureMechanismProperties.cs (.../ClosingStructuresFailureMechanismProperties.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -29,7 +29,6 @@ using Core.Common.Utils.Attributes; using Ringtoets.ClosingStructures.Data; using Ringtoets.ClosingStructures.Forms.Properties; -using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Forms.PropertyClasses; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresFailureMechanismPropertiesTest.cs =================================================================== diff -u -re2f91813f3aae8eb2daef6ff1ffac61d197148a8 -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresFailureMechanismPropertiesTest.cs (.../ClosingStructuresFailureMechanismPropertiesTest.cs) (revision e2f91813f3aae8eb2daef6ff1ffac61d197148a8) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresFailureMechanismPropertiesTest.cs (.../ClosingStructuresFailureMechanismPropertiesTest.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -245,13 +245,13 @@ public void N2A_SetValidValueWithConfirmation_UpdateDataAndNotifyObservers(int value) { // Setup - var failureMechanism = new ClosingStructuresFailureMechanism(); - var mockRepository = new MockRepository(); var observableMock = mockRepository.StrictMock(); observableMock.Expect(o => o.NotifyObservers()); + mockRepository.ReplayAll(); + var failureMechanism = new ClosingStructuresFailureMechanism(); var changeHandler = new FailureMechanismSetPropertyValueAfterConfirmationParameterTester( failureMechanism, value, Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresInputContextPropertiesTest.cs =================================================================== diff -u -r82d54017e93bce01e76c58537c13979c2e1af142 -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresInputContextPropertiesTest.cs (.../ClosingStructuresInputContextPropertiesTest.cs) (revision 82d54017e93bce01e76c58537c13979c2e1af142) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresInputContextPropertiesTest.cs (.../ClosingStructuresInputContextPropertiesTest.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -64,7 +64,7 @@ TestDelegate test = () => new ClosingStructuresInputContextProperties(null); // Assert - var paramName = Assert.Throws(test).ParamName; + string paramName = Assert.Throws(test).ParamName; Assert.AreEqual("data", paramName); } Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/PropertyInfos/ClosingStructuresInputContextPropertyInfoTest.cs =================================================================== diff -u -r0f678f97e76d90e4a7e7f0611ff22ab196b46381 -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/PropertyInfos/ClosingStructuresInputContextPropertyInfoTest.cs (.../ClosingStructuresInputContextPropertyInfoTest.cs) (revision 0f678f97e76d90e4a7e7f0611ff22ab196b46381) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/PropertyInfos/ClosingStructuresInputContextPropertyInfoTest.cs (.../ClosingStructuresInputContextPropertyInfoTest.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -10,6 +10,7 @@ namespace Ringtoets.ClosingStructures.Plugin.Test.PropertyInfos { + [TestFixture] public class ClosingStructuresInputContextPropertyInfoTest { private ClosingStructuresPlugin plugin; Index: Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismBase.cs =================================================================== diff -u -r9122cc6ecd35cdc7e08a2e296524fc55371f5d4c -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismBase.cs (.../FailureMechanismBase.cs) (revision 9122cc6ecd35cdc7e08a2e296524fc55371f5d4c) +++ Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismBase.cs (.../FailureMechanismBase.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -72,7 +72,7 @@ { if (double.IsNaN(value) || value < 0 || value > 100) { - throw new ArgumentOutOfRangeException("value", Resources.Contribution_Value_should_be_in_interval_0_100); + throw new ArgumentOutOfRangeException(nameof(value), Resources.Contribution_Value_should_be_in_interval_0_100); } contribution = value; } @@ -104,7 +104,7 @@ { if (section == null) { - throw new ArgumentNullException("section"); + throw new ArgumentNullException(nameof(section)); } if (!sections.Any()) @@ -127,11 +127,11 @@ var parameterIsRequired = "Parameter is required."; if (string.IsNullOrEmpty(failureMechanismName)) { - throw new ArgumentException(parameterIsRequired, "failureMechanismName"); + throw new ArgumentException(parameterIsRequired, nameof(failureMechanismName)); } if (string.IsNullOrEmpty(failureMechanismCode)) { - throw new ArgumentException(parameterIsRequired, "failureMechanismCode"); + throw new ArgumentException(parameterIsRequired, nameof(failureMechanismCode)); } } @@ -152,7 +152,7 @@ { string message = string.Format(Resources.BaseFailureMechanism_AddSection_Section_0_must_connect_to_existing_sections, sectionToInsert.Name); - throw new ArgumentException(message, "sectionToInsert"); + throw new ArgumentException(message, nameof(sectionToInsert)); } } } Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r9a001397536d9dcca5d009c8518478cdfcddbeca -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -1065,33 +1065,6 @@ } /// - /// Looks up a localized string similar to De waarde voor de faalkans kon niet geïnterpreteerd worden als een getal.. - /// - public static string FailureProbability_Could_not_parse_string_to_double_value { - get { - return ResourceManager.GetString("FailureProbability_Could_not_parse_string_to_double_value", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to De waarde voor de faalkans moet ingevuld zijn.. - /// - public static string FailureProbability_Value_cannot_be_null { - get { - return ResourceManager.GetString("FailureProbability_Value_cannot_be_null", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to De waarde voor de faalkans is te groot of te klein.. - /// - public static string FailureProbability_Value_too_large { - get { - return ResourceManager.GetString("FailureProbability_Value_too_large", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Voorlandprofiel. /// public static string Foreshore_DisplayName { @@ -1603,6 +1576,33 @@ } /// + /// Looks up a localized string similar to De waarde voor de faalkans kon niet geïnterpreteerd worden als een getal.. + /// + public static string Probability_Could_not_parse_string_to_double_value { + get { + return ResourceManager.GetString("Probability_Could_not_parse_string_to_double_value", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to De waarde voor de faalkans moet ingevuld zijn.. + /// + public static string Probability_Value_cannot_be_null { + get { + return ResourceManager.GetString("Probability_Value_cannot_be_null", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to De waarde voor de faalkans is te groot of te klein.. + /// + public static string Probability_Value_too_large { + get { + return ResourceManager.GetString("Probability_Value_too_large", resourceCulture); + } + } + + /// /// Looks up a localized string similar to De veiligheidsfactor voor deze berekening.. /// public static string ProbabilityAssessmentOutput_FactorOfSafety_Description { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx =================================================================== diff -u -r9a001397536d9dcca5d009c8518478cdfcddbeca -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -751,13 +751,13 @@ Modelfactor voor onvolkomen stroming [-] - + De waarde voor de faalkans kon niet geïnterpreteerd worden als een getal. - + De waarde voor de faalkans moet ingevuld zijn. - + De waarde voor de faalkans is te groot of te klein. Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/StructuresInputBaseProperties.cs =================================================================== diff -u -r0f678f97e76d90e4a7e7f0611ff22ab196b46381 -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/StructuresInputBaseProperties.cs (.../StructuresInputBaseProperties.cs) (revision 0f678f97e76d90e4a7e7f0611ff22ab196b46381) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/StructuresInputBaseProperties.cs (.../StructuresInputBaseProperties.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -23,14 +23,12 @@ using System.Collections.Generic; using System.ComponentModel; using System.Drawing.Design; -using System.Linq.Expressions; using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Gui.Attributes; using Core.Common.Gui.PropertyBag; using Core.Common.Utils.Attributes; -using Core.Common.Utils.Reflection; using Ringtoets.Common.Data; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.DikeProfiles; @@ -55,11 +53,11 @@ ObjectProperties>, IHasHydraulicBoundaryLocationProperty, IHasStructureProperty, - IHasForeshoreProfileProperty, + IHasForeshoreProfileProperty, IPropertyChangeHandler where TStructure : StructureBase - where TStructureInput : StructuresInputBase - where TCalculation : ICalculation - where TFailureMechanism : IFailureMechanism + where TStructureInput : StructuresInputBase + where TCalculation : ICalculation + where TFailureMechanism : IFailureMechanism { private readonly Dictionary propertyIndexLookup; @@ -75,60 +73,60 @@ { if (data == null) { - throw new ArgumentNullException("data"); + throw new ArgumentNullException(nameof(data)); } if (constructionProperties == null) { - throw new ArgumentNullException("constructionProperties"); + throw new ArgumentNullException(nameof(constructionProperties)); } Data = data; propertyIndexLookup = new Dictionary { { - GetMemberName(p => p.ModelFactorSuperCriticalFlow), constructionProperties.ModelFactorSuperCriticalFlowPropertyIndex + nameof(ModelFactorSuperCriticalFlow), constructionProperties.ModelFactorSuperCriticalFlowPropertyIndex }, { - GetMemberName(p => p.Structure), constructionProperties.StructurePropertyIndex + nameof(Structure), constructionProperties.StructurePropertyIndex }, { - GetMemberName(p => p.StructureLocation), constructionProperties.StructureLocationPropertyIndex + nameof(StructureLocation), constructionProperties.StructureLocationPropertyIndex }, { - GetMemberName(p => p.StructureNormalOrientation), constructionProperties.StructureNormalOrientationPropertyIndex + nameof(StructureNormalOrientation), constructionProperties.StructureNormalOrientationPropertyIndex }, { - GetMemberName(p => p.FlowWidthAtBottomProtection), constructionProperties.FlowWidthAtBottomProtectionPropertyIndex + nameof(FlowWidthAtBottomProtection), constructionProperties.FlowWidthAtBottomProtectionPropertyIndex }, { - GetMemberName(p => p.WidthFlowApertures), constructionProperties.WidthFlowAperturesPropertyIndex + nameof(WidthFlowApertures), constructionProperties.WidthFlowAperturesPropertyIndex }, { - GetMemberName(p => p.StorageStructureArea), constructionProperties.StorageStructureAreaPropertyIndex + nameof(StorageStructureArea), constructionProperties.StorageStructureAreaPropertyIndex }, { - GetMemberName(p => p.AllowedLevelIncreaseStorage), constructionProperties.AllowedLevelIncreaseStoragePropertyIndex + nameof(AllowedLevelIncreaseStorage), constructionProperties.AllowedLevelIncreaseStoragePropertyIndex }, { - GetMemberName(p => p.CriticalOvertoppingDischarge), constructionProperties.CriticalOvertoppingDischargePropertyIndex + nameof(CriticalOvertoppingDischarge), constructionProperties.CriticalOvertoppingDischargePropertyIndex }, { - GetMemberName(p => p.FailureProbabilityStructureWithErosion), constructionProperties.FailureProbabilityStructureWithErosionPropertyIndex + nameof(FailureProbabilityStructureWithErosion), constructionProperties.FailureProbabilityStructureWithErosionPropertyIndex }, { - GetMemberName(p => p.ForeshoreProfile), constructionProperties.ForeshoreProfilePropertyIndex + nameof(ForeshoreProfile), constructionProperties.ForeshoreProfilePropertyIndex }, { - GetMemberName(p => p.UseBreakWater), constructionProperties.UseBreakWaterPropertyIndex + nameof(UseBreakWater), constructionProperties.UseBreakWaterPropertyIndex }, { - GetMemberName(p => p.UseForeshore), constructionProperties.UseForeshorePropertyIndex + nameof(UseForeshore), constructionProperties.UseForeshorePropertyIndex }, { - GetMemberName(p => p.SelectedHydraulicBoundaryLocation), constructionProperties.HydraulicBoundaryLocationPropertyIndex + nameof(SelectedHydraulicBoundaryLocation), constructionProperties.HydraulicBoundaryLocationPropertyIndex }, { - GetMemberName(p => p.StormDuration), constructionProperties.StormDurationPropertyIndex + nameof(StormDuration), constructionProperties.StormDurationPropertyIndex } }; } @@ -153,160 +151,6 @@ #endregion - [DynamicPropertyOrderEvaluationMethod] - public int DynamicPropertyOrderEvaluationMethod(string propertyName) - { - int propertyIndex; - - propertyIndexLookup.TryGetValue(propertyName, out propertyIndex); - - return propertyIndex; - } - - public abstract IEnumerable GetAvailableForeshoreProfiles(); - - public IEnumerable GetSelectableHydraulicBoundaryLocations() - { - return SelectableHydraulicBoundaryLocationHelper.GetSortedSelectableHydraulicBoundaryLocations( - data.AvailableHydraulicBoundaryLocations, StructureLocation); - } - - public abstract IEnumerable GetAvailableStructures(); - - /// - /// The action to perform after setting the property. - /// - protected abstract void AfterSettingStructure(); - - /// - /// Sets a probability value to one of the properties of a wrapped data object. - /// - /// The type of the wrapped data to set a probability value for. - /// The probability value to set. - /// The wrapped data to set a probability value for. - /// The action that sets the probability value to a specific property of the wrapped data. - /// Thrown when equals null. - /// Thrown when cannot be parsed into a double. - protected static void SetProbabilityValue(string value, - TStructureInput structureInput, - Action setValueAction) - { - if (value == null) - { - throw new ArgumentNullException("value", Resources.FailureProbability_Value_cannot_be_null); - } - try - { - setValueAction(structureInput, (RoundedDouble) double.Parse(value)); - } - catch (OverflowException) - { - throw new ArgumentException(Resources.FailureProbability_Value_too_large); - } - catch (FormatException) - { - throw new ArgumentException(Resources.FailureProbability_Could_not_parse_string_to_double_value); - } - } - - private static string GetMemberName(Expression, object>> expression) - { - return TypeUtils.GetMemberName(expression); - } - - /// - /// Class holding the various construction parameters for . - /// - public class ConstructionProperties - { - #region Model factors - - /// - /// Gets or sets the property index for . - /// - public int ModelFactorSuperCriticalFlowPropertyIndex { get; set; } - - #endregion - - #region Schematization - - /// - /// Gets or sets the property index for . - /// - public int StructurePropertyIndex { get; set; } - - /// - /// Gets or sets the property index for the location of . - /// - public int StructureLocationPropertyIndex { get; set; } - - /// - /// Gets or sets the property index for . - /// - public int StructureNormalOrientationPropertyIndex { get; set; } - - /// - /// Gets or sets the property index for . - /// - public int FlowWidthAtBottomProtectionPropertyIndex { get; set; } - - /// - /// Gets or sets the property index for . - /// - public int WidthFlowAperturesPropertyIndex { get; set; } - - /// - /// Gets or sets the property index for . - /// - public int StorageStructureAreaPropertyIndex { get; set; } - - /// - /// Gets or sets the property index for . - /// - public int AllowedLevelIncreaseStoragePropertyIndex { get; set; } - - /// - /// Gets or sets the property index for . - /// - public int CriticalOvertoppingDischargePropertyIndex { get; set; } - - /// - /// Gets or sets the property index for . - /// - public int FailureProbabilityStructureWithErosionPropertyIndex { get; set; } - - /// - /// Gets or sets the property index for . - /// - public int ForeshoreProfilePropertyIndex { get; set; } - - /// - /// Gets or sets the property index for . - /// - public int UseBreakWaterPropertyIndex { get; set; } - - /// - /// Gets or sets the property index for . - /// - public int UseForeshorePropertyIndex { get; set; } - - #endregion - - #region Hydraulic data - - /// - /// Gets or sets the property index for . - /// - public int HydraulicBoundaryLocationPropertyIndex { get; set; } - - /// - /// Gets or sets the property index for . - /// - public int StormDurationPropertyIndex { get; set; } - - #endregion - } - #region Schematization [DynamicPropertyOrder] @@ -405,7 +249,7 @@ get { return new VariationCoefficientLogNormalDistributionProperties( - VariationCoefficientDistributionPropertiesReadOnly.None, + VariationCoefficientDistributionPropertiesReadOnly.None, data.WrappedData, this) { @@ -557,11 +401,65 @@ #endregion + [DynamicPropertyOrderEvaluationMethod] + public int DynamicPropertyOrderEvaluationMethod(string propertyName) + { + int propertyIndex; + + propertyIndexLookup.TryGetValue(propertyName, out propertyIndex); + + return propertyIndex; + } + + public abstract IEnumerable GetAvailableForeshoreProfiles(); + public abstract IEnumerable GetAvailableStructures(); + + public IEnumerable GetSelectableHydraulicBoundaryLocations() + { + return SelectableHydraulicBoundaryLocationHelper.GetSortedSelectableHydraulicBoundaryLocations( + data.AvailableHydraulicBoundaryLocations, StructureLocation); + } + public void PropertyChanged() { ClearCalculationOutput(); } + /// + /// Sets a probability value to one of the properties of a wrapped data object. + /// + /// The probability value to set. + /// The wrapped data to set a probability value for. + /// The action that sets the probability value to a specific property of the wrapped data. + /// Thrown when equals null. + /// Thrown when cannot be parsed into a double. + protected static void SetProbabilityValue(string value, + TStructureInput structureInput, + Action setValueAction) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value), Resources.Probability_Value_cannot_be_null); + } + try + { + setValueAction(structureInput, (RoundedDouble) double.Parse(value)); + } + catch (OverflowException) + { + throw new ArgumentException(Resources.Probability_Value_too_large); + } + catch (FormatException) + { + throw new ArgumentException(Resources.Probability_Could_not_parse_string_to_double_value); + } + } + + /// + /// The action to perform after setting the property. + /// + protected abstract void AfterSettingStructure(); + protected void ClearOutputAndNotifyPropertyChanged() { ClearCalculationOutput(); @@ -576,5 +474,98 @@ calculation.NotifyObservers(); } } + + /// + /// Class holding the various construction parameters for . + /// + public class ConstructionProperties + { + #region Model factors + + /// + /// Gets or sets the property index for . + /// + public int ModelFactorSuperCriticalFlowPropertyIndex { get; set; } + + #endregion + + #region Schematization + + /// + /// Gets or sets the property index for . + /// + public int StructurePropertyIndex { get; set; } + + /// + /// Gets or sets the property index for the location of . + /// + public int StructureLocationPropertyIndex { get; set; } + + /// + /// Gets or sets the property index for . + /// + public int StructureNormalOrientationPropertyIndex { get; set; } + + /// + /// Gets or sets the property index for . + /// + public int FlowWidthAtBottomProtectionPropertyIndex { get; set; } + + /// + /// Gets or sets the property index for . + /// + public int WidthFlowAperturesPropertyIndex { get; set; } + + /// + /// Gets or sets the property index for . + /// + public int StorageStructureAreaPropertyIndex { get; set; } + + /// + /// Gets or sets the property index for . + /// + public int AllowedLevelIncreaseStoragePropertyIndex { get; set; } + + /// + /// Gets or sets the property index for . + /// + public int CriticalOvertoppingDischargePropertyIndex { get; set; } + + /// + /// Gets or sets the property index for . + /// + public int FailureProbabilityStructureWithErosionPropertyIndex { get; set; } + + /// + /// Gets or sets the property index for . + /// + public int ForeshoreProfilePropertyIndex { get; set; } + + /// + /// Gets or sets the property index for . + /// + public int UseBreakWaterPropertyIndex { get; set; } + + /// + /// Gets or sets the property index for . + /// + public int UseForeshorePropertyIndex { get; set; } + + #endregion + + #region Hydraulic data + + /// + /// Gets or sets the property index for . + /// + public int HydraulicBoundaryLocationPropertyIndex { get; set; } + + /// + /// Gets or sets the property index for . + /// + public int StormDurationPropertyIndex { get; set; } + + #endregion + } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/VariationCoefficientDistributionPropertiesBase.cs =================================================================== diff -u -rdbfba4c1829b1d42f4d99a88f7d8699bc3beeb2a -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/VariationCoefficientDistributionPropertiesBase.cs (.../VariationCoefficientDistributionPropertiesBase.cs) (revision dbfba4c1829b1d42f4d99a88f7d8699bc3beeb2a) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/VariationCoefficientDistributionPropertiesBase.cs (.../VariationCoefficientDistributionPropertiesBase.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -60,14 +60,14 @@ { if (observable == null && !propertiesReadOnly.HasFlag(VariationCoefficientDistributionPropertiesReadOnly.All)) { - throw new ArgumentException(@"Observable must be specified unless no property can be set.", "observable"); + throw new ArgumentException(@"Observable must be specified unless no property can be set.", nameof(observable)); } isMeanReadOnly = propertiesReadOnly.HasFlag(VariationCoefficientDistributionPropertiesReadOnly.Mean); isVariationCoefficientReadOnly = propertiesReadOnly.HasFlag(VariationCoefficientDistributionPropertiesReadOnly.CoefficientOfVariation); - meanDisplayName = TypeUtils.GetMemberName>(d => d.Mean); - variationCoefficientDisplayName = TypeUtils.GetMemberName>(d => d.CoefficientOfVariation); + meanDisplayName = nameof(Mean); + variationCoefficientDisplayName = nameof(CoefficientOfVariation); this.observable = observable; changeHandler = handler; @@ -91,7 +91,7 @@ { if (isMeanReadOnly) { - throw new InvalidOperationException("Mean is set to be read-only."); + throw new InvalidOperationException($"{nameof(Mean)} is set to be read-only."); } data.Mean = value; NotifyPropertyChanged(); @@ -111,7 +111,7 @@ { if (isVariationCoefficientReadOnly) { - throw new InvalidOperationException("CoefficientOfVariation is set to be read-only."); + throw new InvalidOperationException($"{nameof(CoefficientOfVariation)} is set to be read-only."); } data.CoefficientOfVariation = value; NotifyPropertyChanged(); @@ -135,8 +135,7 @@ public override string ToString() { return data == null ? string.Empty : - string.Format("{0} ({1} = {2})", - Mean, Resources.Distribution_VariationCoefficient_DisplayName, CoefficientOfVariation); + $"{Mean} ({Resources.Distribution_VariationCoefficient_DisplayName} = {CoefficientOfVariation})"; } /// Index: Ringtoets/Common/src/Ringtoets.Common.Service/RingtoetsCommonDataSynchronizationService.cs =================================================================== diff -u -r9b170a1e782de70c1d70bf489a6dac744bdbd9b4 -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/Common/src/Ringtoets.Common.Service/RingtoetsCommonDataSynchronizationService.cs (.../RingtoetsCommonDataSynchronizationService.cs) (revision 9b170a1e782de70c1d70bf489a6dac744bdbd9b4) +++ Ringtoets/Common/src/Ringtoets.Common.Service/RingtoetsCommonDataSynchronizationService.cs (.../RingtoetsCommonDataSynchronizationService.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -93,7 +93,7 @@ var affectedObjects = new Collection(); foreach (StructuresCalculation calculation in calculations.Where(c => ReferenceEquals(c.InputParameters.ForeshoreProfile, profile))) { - foreach (var calculationWithRemovedOutput in ClearCalculationOutput(calculation)) + foreach (IObservable calculationWithRemovedOutput in ClearCalculationOutput(calculation)) { affectedObjects.Add(calculationWithRemovedOutput); } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/FailureMechanismPropertyChangeHandlerTest.cs =================================================================== diff -u -re2f91813f3aae8eb2daef6ff1ffac61d197148a8 -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/FailureMechanismPropertyChangeHandlerTest.cs (.../FailureMechanismPropertyChangeHandlerTest.cs) (revision e2f91813f3aae8eb2daef6ff1ffac61d197148a8) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/FailureMechanismPropertyChangeHandlerTest.cs (.../FailureMechanismPropertyChangeHandlerTest.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -27,7 +27,7 @@ (f, v) => { }); // Assert - var paramName = Assert.Throws(test).ParamName; + string paramName = Assert.Throws(test).ParamName; Assert.AreEqual("failureMechanism", paramName); } @@ -44,7 +44,7 @@ (f, v) => { }); // Assert - var paramName = Assert.Throws(test).ParamName; + string paramName = Assert.Throws(test).ParamName; Assert.AreEqual("value", paramName); } @@ -61,7 +61,7 @@ null); // Assert - var paramName = Assert.Throws(test).ParamName; + string paramName = Assert.Throws(test).ParamName; Assert.AreEqual("setValue", paramName); } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/StructuresInputBasePropertiesTest.cs =================================================================== diff -u -r0f678f97e76d90e4a7e7f0611ff22ab196b46381 -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/StructuresInputBasePropertiesTest.cs (.../StructuresInputBasePropertiesTest.cs) (revision 0f678f97e76d90e4a7e7f0611ff22ab196b46381) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/StructuresInputBasePropertiesTest.cs (.../StructuresInputBasePropertiesTest.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -82,7 +82,7 @@ public void Constructor_DataIsNull_ThrowsArgumentNullException() { // Setup - var constructionProperties = GetRandomConstructionProperties(); + SimpleStructuresInputProperties.ConstructionProperties constructionProperties = GetRandomConstructionProperties(); // Call TestDelegate call = () => new SimpleStructuresInputProperties(null, constructionProperties); @@ -96,12 +96,12 @@ public void Constructor_ValidValues_ExpectedValues() { // Setup - var constructionProperties = GetRandomConstructionProperties(); var assessmentSectionStub = mockRepository.Stub(); var failureMechanismStub = mockRepository.Stub(); mockRepository.ReplayAll(); + SimpleStructuresInputProperties.ConstructionProperties constructionProperties = GetRandomConstructionProperties(); var calculation = new StructuresCalculation(); var inputContext = new SimpleInputContext(calculation.InputParameters, calculation, @@ -146,12 +146,12 @@ public void Constructor_ValidValues_PropertiesHaveExpectedAttributesValues() { // Setup - var constructionProperties = GetRandomConstructionProperties(); var assessmentSectionStub = mockRepository.Stub(); var failureMechanismStub = mockRepository.Stub(); mockRepository.ReplayAll(); + SimpleStructuresInputProperties.ConstructionProperties constructionProperties = GetRandomConstructionProperties(); var calculation = new StructuresCalculation(); var inputContext = new SimpleInputContext(calculation.InputParameters, calculation, @@ -285,7 +285,7 @@ assessmentSectionStub); var properties = new SimpleStructuresInputProperties( inputContext, - new StructuresInputBaseProperties, IFailureMechanism>.ConstructionProperties()); + new SimpleStructuresInputProperties.ConstructionProperties()); SelectableHydraulicBoundaryLocation selectedHydraulicBoundaryLocation = null; @@ -326,7 +326,7 @@ assessmentSectionStub); var properties = new SimpleStructuresInputProperties( inputContext, - new StructuresInputBaseProperties, IFailureMechanism>.ConstructionProperties()); + new SimpleStructuresInputProperties.ConstructionProperties()); // Call var availableHydraulicBoundaryLocations = properties.GetSelectableHydraulicBoundaryLocations(); @@ -375,7 +375,7 @@ assessmentSectionStub); var properties = new SimpleStructuresInputProperties( inputContext, - new StructuresInputBaseProperties, IFailureMechanism>.ConstructionProperties()); + new SimpleStructuresInputProperties.ConstructionProperties()); // Call var availableHydraulicBoundaryLocations = properties.GetSelectableHydraulicBoundaryLocations(); @@ -426,7 +426,7 @@ assessmentSectionStub); var properties = new SimpleStructuresInputProperties( inputContext, - new StructuresInputBaseProperties, IFailureMechanism>.ConstructionProperties()); + new SimpleStructuresInputProperties.ConstructionProperties()); IEnumerable originalList = properties.GetSelectableHydraulicBoundaryLocations() .ToList(); @@ -476,7 +476,7 @@ assessmentSectionStub); var properties = new SimpleStructuresInputProperties( inputContext, - new StructuresInputBaseProperties, IFailureMechanism>.ConstructionProperties()); + new SimpleStructuresInputProperties.ConstructionProperties()); inputContext.Attach(observerMock); @@ -569,7 +569,7 @@ assessmentSectionStub); var properties = new SimpleStructuresInputProperties( inputContext, - new StructuresInputBaseProperties, IFailureMechanism>.ConstructionProperties()); + new SimpleStructuresInputProperties.ConstructionProperties()); // Precondition Assert.IsFalse(properties.AfterSettingStructureCalled); @@ -596,7 +596,7 @@ assessmentSectionStub); var properties = new SimpleStructuresInputProperties( inputContext, - new StructuresInputBaseProperties, IFailureMechanism>.ConstructionProperties()); + new SimpleStructuresInputProperties.ConstructionProperties()); // Precondition Assert.IsFalse(properties.AfterSettingStructureCalled); @@ -625,7 +625,7 @@ assessmentSectionStub); var properties = new SimpleStructuresInputProperties( inputContext, - new StructuresInputBaseProperties, IFailureMechanism>.ConstructionProperties()); + new SimpleStructuresInputProperties.ConstructionProperties()); // Call TestDelegate call = () => properties.FailureProbabilityStructureWithErosion = newValue.ToString(CultureInfo.InvariantCulture); @@ -654,7 +654,7 @@ assessmentSectionStub); var properties = new SimpleStructuresInputProperties( inputContext, - new StructuresInputBaseProperties, IFailureMechanism>.ConstructionProperties()); + new SimpleStructuresInputProperties.ConstructionProperties()); // Call TestDelegate call = () => properties.FailureProbabilityStructureWithErosion = newValue; @@ -681,7 +681,7 @@ assessmentSectionStub); var properties = new SimpleStructuresInputProperties( inputContext, - new StructuresInputBaseProperties, IFailureMechanism>.ConstructionProperties()); + new SimpleStructuresInputProperties.ConstructionProperties()); // Call TestDelegate call = () => properties.FailureProbabilityStructureWithErosion = null; @@ -693,7 +693,7 @@ mockRepository.VerifyAll(); } - private StructuresInputBaseProperties, IFailureMechanism>.ConstructionProperties GetRandomConstructionProperties() + private static SimpleStructuresInputProperties.ConstructionProperties GetRandomConstructionProperties() { var structureObject = new object(); var structureLocationObject = new object(); @@ -732,7 +732,7 @@ }.OrderBy(p => random.Next()) .ToList(); - return new StructuresInputBaseProperties, IFailureMechanism>.ConstructionProperties + return new SimpleStructuresInputProperties.ConstructionProperties { StructurePropertyIndex = randomObjectLookup.IndexOf(structureObject), StructureLocationPropertyIndex = randomObjectLookup.IndexOf(structureLocationObject), Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/GrassCoverErosionOutwardsFailureMechanismPropertyChangeHandlerTest.cs =================================================================== diff -u -re2f91813f3aae8eb2daef6ff1ffac61d197148a8 -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/GrassCoverErosionOutwardsFailureMechanismPropertyChangeHandlerTest.cs (.../GrassCoverErosionOutwardsFailureMechanismPropertyChangeHandlerTest.cs) (revision e2f91813f3aae8eb2daef6ff1ffac61d197148a8) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/GrassCoverErosionOutwardsFailureMechanismPropertyChangeHandlerTest.cs (.../GrassCoverErosionOutwardsFailureMechanismPropertyChangeHandlerTest.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -28,7 +28,7 @@ (f, v) => { }); // Assert - var paramName = Assert.Throws(test).ParamName; + string paramName = Assert.Throws(test).ParamName; Assert.AreEqual("failureMechanism", paramName); } @@ -45,7 +45,7 @@ (f, v) => { }); // Assert - var paramName = Assert.Throws(test).ParamName; + string paramName = Assert.Throws(test).ParamName; Assert.AreEqual("value", paramName); } @@ -62,7 +62,7 @@ null); // Assert - var paramName = Assert.Throws(test).ParamName; + string paramName = Assert.Throws(test).ParamName; Assert.AreEqual("setValue", paramName); } Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresInputContextPropertiesTest.cs =================================================================== diff -u -r2a0fbe6ec22928831305671ecd4f41030b827250 -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresInputContextPropertiesTest.cs (.../HeightStructuresInputContextPropertiesTest.cs) (revision 2a0fbe6ec22928831305671ecd4f41030b827250) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresInputContextPropertiesTest.cs (.../HeightStructuresInputContextPropertiesTest.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -74,7 +74,7 @@ TestDelegate test = () => new HeightStructuresInputContextProperties(null); // Assert - var paramName = Assert.Throws(test).ParamName; + string paramName = Assert.Throws(test).ParamName; Assert.AreEqual("data", paramName); } Index: Ringtoets/Integration/src/Ringtoets.Integration.Service/RingtoetsDataSynchronizationService.cs =================================================================== diff -u -r9b170a1e782de70c1d70bf489a6dac744bdbd9b4 -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/Integration/src/Ringtoets.Integration.Service/RingtoetsDataSynchronizationService.cs (.../RingtoetsDataSynchronizationService.cs) (revision 9b170a1e782de70c1d70bf489a6dac744bdbd9b4) +++ Ringtoets/Integration/src/Ringtoets.Integration.Service/RingtoetsDataSynchronizationService.cs (.../RingtoetsDataSynchronizationService.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -578,7 +578,7 @@ var changedObservables = new List(); foreach (Tuple input in calculationInputs.Where(input => ReferenceEquals(input.Item2.ForeshoreProfile, profile))) { - foreach (var calculationWithRemovedOutput in RingtoetsCommonDataSynchronizationService.ClearCalculationOutput(input.Item1)) + foreach (IObservable calculationWithRemovedOutput in RingtoetsCommonDataSynchronizationService.ClearCalculationOutput(input.Item1)) { changedObservables.Add(calculationWithRemovedOutput); } Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/FailureMechanismContributionPropertiesTest.cs =================================================================== diff -u -r9122cc6ecd35cdc7e08a2e296524fc55371f5d4c -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/FailureMechanismContributionPropertiesTest.cs (.../FailureMechanismContributionPropertiesTest.cs) (revision 9122cc6ecd35cdc7e08a2e296524fc55371f5d4c) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/FailureMechanismContributionPropertiesTest.cs (.../FailureMechanismContributionPropertiesTest.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -72,7 +72,7 @@ var assessmentSectionChangeHandler = mockRepository.Stub(); mockRepository.ReplayAll(); - var failureMechanismContribution = CreateFailureMechanismContribution(); + FailureMechanismContribution failureMechanismContribution = CreateFailureMechanismContribution(); // Call TestDelegate test = () => new FailureMechanismContributionProperties( @@ -96,7 +96,7 @@ var assessmentSectionChangeHandler = mockRepository.Stub(); mockRepository.ReplayAll(); - var failureMechanismContribution = CreateFailureMechanismContribution(); + FailureMechanismContribution failureMechanismContribution = CreateFailureMechanismContribution(); // Call TestDelegate test = () => new FailureMechanismContributionProperties( @@ -120,7 +120,7 @@ var failureMechanismChangeHandler = mockRepository.Stub(); mockRepository.ReplayAll(); - var failureMechanismContribution = CreateFailureMechanismContribution(); + FailureMechanismContribution failureMechanismContribution = CreateFailureMechanismContribution(); // Call TestDelegate test = () => new FailureMechanismContributionProperties( @@ -145,7 +145,7 @@ var assessmentSectionChangeHandler = mockRepository.Stub(); mockRepository.ReplayAll(); - var failureMechanismContribution = CreateFailureMechanismContribution(); + FailureMechanismContribution failureMechanismContribution = CreateFailureMechanismContribution(); // Call var properties = new FailureMechanismContributionProperties( Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs =================================================================== diff -u -r9b170a1e782de70c1d70bf489a6dac744bdbd9b4 -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs (.../RingtoetsDataSynchronizationServiceTest.cs) (revision 9b170a1e782de70c1d70bf489a6dac744bdbd9b4) +++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs (.../RingtoetsDataSynchronizationServiceTest.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -818,9 +818,11 @@ // Setup StabilityStoneCoverFailureMechanism failureMechanism = TestDataGenerator.GetFullyConfiguredStabilityStoneCoverFailureMechanism(); ForeshoreProfile profile = failureMechanism.ForeshoreProfiles[0]; - StabilityStoneCoverWaveConditionsCalculation[] calculationsWithForeshoreProfile = failureMechanism.Calculations.Cast() - .Where(c => ReferenceEquals(c.InputParameters.ForeshoreProfile, profile)) - .ToArray(); + StabilityStoneCoverWaveConditionsCalculation[] calculationsWithForeshoreProfile = + failureMechanism.Calculations + .Cast() + .Where(c => ReferenceEquals(c.InputParameters.ForeshoreProfile, profile)) + .ToArray(); StabilityStoneCoverWaveConditionsCalculation[] calculationsWithOutput = calculationsWithForeshoreProfile.Where(c => c.HasOutput).ToArray(); @@ -891,9 +893,11 @@ // Setup WaveImpactAsphaltCoverFailureMechanism failureMechanism = TestDataGenerator.GetFullyConfiguredWaveImpactAsphaltCoverFailureMechanism(); ForeshoreProfile profile = failureMechanism.ForeshoreProfiles[0]; - WaveImpactAsphaltCoverWaveConditionsCalculation[] calculationsWithForeshoreProfile = failureMechanism.Calculations.Cast() - .Where(c => ReferenceEquals(c.InputParameters.ForeshoreProfile, profile)) - .ToArray(); + WaveImpactAsphaltCoverWaveConditionsCalculation[] calculationsWithForeshoreProfile = + failureMechanism.Calculations + .Cast() + .Where(c => ReferenceEquals(c.InputParameters.ForeshoreProfile, profile)) + .ToArray(); WaveImpactAsphaltCoverWaveConditionsCalculation[] calculationsWithOutput = calculationsWithForeshoreProfile.Where(c => c.HasOutput).ToArray(); @@ -1038,9 +1042,11 @@ // Setup HeightStructuresFailureMechanism failureMechanism = TestDataGenerator.GetFullyConfiguredHeightStructuresFailureMechanism(); ForeshoreProfile profile = failureMechanism.ForeshoreProfiles[0]; - StructuresCalculation[] calculationsWithForeshoreProfile = failureMechanism.Calculations.Cast>() - .Where(c => ReferenceEquals(c.InputParameters.ForeshoreProfile, profile)) - .ToArray(); + StructuresCalculation[] calculationsWithForeshoreProfile = + failureMechanism.Calculations + .Cast>() + .Where(c => ReferenceEquals(c.InputParameters.ForeshoreProfile, profile)) + .ToArray(); StructuresCalculation[] calculationsWithOutput = calculationsWithForeshoreProfile.Where(c => c.HasOutput).ToArray(); @@ -1111,9 +1117,11 @@ // Setup ClosingStructuresFailureMechanism failureMechanism = TestDataGenerator.GetFullyConfiguredClosingStructuresFailureMechanism(); ForeshoreProfile profile = failureMechanism.ForeshoreProfiles[0]; - StructuresCalculation[] calculationsWithForeshoreProfile = failureMechanism.Calculations.Cast>() - .Where(c => ReferenceEquals(c.InputParameters.ForeshoreProfile, profile)) - .ToArray(); + StructuresCalculation[] calculationsWithForeshoreProfile = + failureMechanism.Calculations + .Cast>() + .Where(c => ReferenceEquals(c.InputParameters.ForeshoreProfile, profile)) + .ToArray(); StructuresCalculation[] calculationsWithOutput = calculationsWithForeshoreProfile.Where(c => c.HasOutput).ToArray(); @@ -1184,9 +1192,11 @@ // Setup StabilityPointStructuresFailureMechanism failureMechanism = TestDataGenerator.GetFullyConfiguredStabilityPointStructuresFailureMechanism(); ForeshoreProfile profile = failureMechanism.ForeshoreProfiles[0]; - StructuresCalculation[] calculationsWithForeshoreProfile = failureMechanism.Calculations.Cast>() - .Where(c => ReferenceEquals(c.InputParameters.ForeshoreProfile, profile)) - .ToArray(); + StructuresCalculation[] calculationsWithForeshoreProfile = + failureMechanism.Calculations + .Cast>() + .Where(c => ReferenceEquals(c.InputParameters.ForeshoreProfile, profile)) + .ToArray(); StructuresCalculation[] calculationsWithOutput = calculationsWithForeshoreProfile.Where(c => c.HasOutput).ToArray(); Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresInputContextProperties.cs =================================================================== diff -u -r2a0fbe6ec22928831305671ecd4f41030b827250 -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresInputContextProperties.cs (.../StabilityPointStructuresInputContextProperties.cs) (revision 2a0fbe6ec22928831305671ecd4f41030b827250) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresInputContextProperties.cs (.../StabilityPointStructuresInputContextProperties.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -121,19 +121,19 @@ if (data.WrappedData.InflowModelType == StabilityPointStructureInflowModelType.FloodedCulvert || data.WrappedData.InflowModelType == StabilityPointStructureInflowModelType.LowSill) { - if (propertyName == TypeUtils.GetMemberName(p => p.ModelFactorSuperCriticalFlow)) + if (propertyName == nameof(ModelFactorSuperCriticalFlow)) { return data.WrappedData.InflowModelType == StabilityPointStructureInflowModelType.LowSill; } - if (propertyName == TypeUtils.GetMemberName(p => p.DrainCoefficient)) + if (propertyName == nameof(DrainCoefficient)) { return data.WrappedData.InflowModelType == StabilityPointStructureInflowModelType.FloodedCulvert; } - if (propertyName == TypeUtils.GetMemberName(p => p.AreaFlowApertures)) + if (propertyName == nameof(AreaFlowApertures)) { return data.WrappedData.InflowModelType == StabilityPointStructureInflowModelType.FloodedCulvert; } - if (propertyName == TypeUtils.GetMemberName(p => p.WidthFlowApertures)) + if (propertyName == nameof(WidthFlowApertures)) { return data.WrappedData.InflowModelType == StabilityPointStructureInflowModelType.LowSill; } @@ -143,19 +143,19 @@ if (data.WrappedData.LoadSchematizationType == LoadSchematizationType.Linear || data.WrappedData.LoadSchematizationType == LoadSchematizationType.Quadratic) { - if (propertyName == TypeUtils.GetMemberName(p => p.ConstructiveStrengthLinearLoadModel)) + if (propertyName == nameof(ConstructiveStrengthLinearLoadModel)) { return data.WrappedData.LoadSchematizationType == LoadSchematizationType.Linear; } - if (propertyName == TypeUtils.GetMemberName(p => p.ConstructiveStrengthQuadraticLoadModel)) + if (propertyName == nameof(ConstructiveStrengthQuadraticLoadModel)) { return data.WrappedData.LoadSchematizationType == LoadSchematizationType.Quadratic; } - if (propertyName == TypeUtils.GetMemberName(p => p.StabilityLinearLoadModel)) + if (propertyName == nameof(StabilityLinearLoadModel)) { return data.WrappedData.LoadSchematizationType == LoadSchematizationType.Linear; } - if (propertyName == TypeUtils.GetMemberName(p => p.StabilityQuadraticLoadModel)) + if (propertyName == nameof(StabilityQuadraticLoadModel)) { return data.WrappedData.LoadSchematizationType == LoadSchematizationType.Quadratic; } Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresInputContextPropertiesTest.cs =================================================================== diff -u -r2a0fbe6ec22928831305671ecd4f41030b827250 -re7b22b417acc51a88beb210ba39fef0f75e2760e --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresInputContextPropertiesTest.cs (.../StabilityPointStructuresInputContextPropertiesTest.cs) (revision 2a0fbe6ec22928831305671ecd4f41030b827250) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresInputContextPropertiesTest.cs (.../StabilityPointStructuresInputContextPropertiesTest.cs) (revision e7b22b417acc51a88beb210ba39fef0f75e2760e) @@ -33,6 +33,7 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.Data.TestUtil; @@ -63,7 +64,7 @@ TestDelegate test = () => new StabilityPointStructuresInputContextProperties(null); // Assert - var paramName = Assert.Throws(test).ParamName; + string paramName = Assert.Throws(test).ParamName; Assert.AreEqual("data", paramName); } @@ -873,7 +874,7 @@ var properties = new StabilityPointStructuresInputContextProperties(inputContext); // Call - var availableForeshoreProfiles = properties.GetAvailableForeshoreProfiles(); + IEnumerable availableForeshoreProfiles = properties.GetAvailableForeshoreProfiles(); // Assert Assert.AreSame(failureMechanism.ForeshoreProfiles, availableForeshoreProfiles); @@ -902,7 +903,7 @@ var properties = new StabilityPointStructuresInputContextProperties(inputContext); // Call - var availableStructures = properties.GetAvailableStructures(); + IEnumerable availableStructures = properties.GetAvailableStructures(); // Assert Assert.AreSame(failureMechanism.StabilityPointStructures, availableStructures);