Index: Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/Properties/Resources.Designer.cs
===================================================================
diff -u -r767fd4c880443be2882b7510b290bd690c938fdc -r240b188f86b1a819b9d8deba075589446e60b9fa
--- Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 767fd4c880443be2882b7510b290bd690c938fdc)
+++ Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 240b188f86b1a819b9d8deba075589446e60b9fa)
@@ -103,36 +103,36 @@
///
/// Looks up a localized string similar to De parameter 'C' die gebruikt wordt om het lengte-effect te berekenen..
///
- public static string ClosingStructuresFailureMechanismProperties_C_Description {
+ public static string ClosingStructuresFailurePathProperties_C_Description {
get {
- return ResourceManager.GetString("ClosingStructuresFailureMechanismProperties_C_Description", resourceCulture);
+ return ResourceManager.GetString("ClosingStructuresFailurePathProperties_C_Description", resourceCulture);
}
}
///
/// Looks up a localized string similar to C [-].
///
- public static string ClosingStructuresFailureMechanismProperties_C_DisplayName {
+ public static string ClosingStructuresFailurePathProperties_C_DisplayName {
get {
- return ResourceManager.GetString("ClosingStructuresFailureMechanismProperties_C_DisplayName", resourceCulture);
+ return ResourceManager.GetString("ClosingStructuresFailurePathProperties_C_DisplayName", resourceCulture);
}
}
///
/// Looks up a localized string similar to De parameter '2NA' die gebruikt wordt om het lengte-effect te berekenen..
///
- public static string ClosingStructuresFailureMechanismProperties_N2A_Description {
+ public static string ClosingStructuresFailurePathProperties_N2A_Description {
get {
- return ResourceManager.GetString("ClosingStructuresFailureMechanismProperties_N2A_Description", resourceCulture);
+ return ResourceManager.GetString("ClosingStructuresFailurePathProperties_N2A_Description", resourceCulture);
}
}
///
/// Looks up a localized string similar to 2NA [-].
///
- public static string ClosingStructuresFailureMechanismProperties_N2A_DisplayName {
+ public static string ClosingStructuresFailurePathProperties_N2A_DisplayName {
get {
- return ResourceManager.GetString("ClosingStructuresFailureMechanismProperties_N2A_DisplayName", resourceCulture);
+ return ResourceManager.GetString("ClosingStructuresFailurePathProperties_N2A_DisplayName", resourceCulture);
}
}
Index: Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/Properties/Resources.resx
===================================================================
diff -u -r4e8d9d5f3b19a4bcd8c6d217e3d2b180d3171915 -r240b188f86b1a819b9d8deba075589446e60b9fa
--- Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/Properties/Resources.resx (.../Resources.resx) (revision 4e8d9d5f3b19a4bcd8c6d217e3d2b180d3171915)
+++ Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/Properties/Resources.resx (.../Resources.resx) (revision 240b188f86b1a819b9d8deba075589446e60b9fa)
@@ -147,16 +147,16 @@
Faalkans herstel van gefaalde situatie [-]
-
+
De parameter 'C' die gebruikt wordt om het lengte-effect te berekenen.
-
+
C [-]
-
+
De parameter '2NA' die gebruikt wordt om het lengte-effect te berekenen.
-
+
2NA [-]
Index: Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/PropertyClasses/ClosingStructuresCalculationsProperties.cs
===================================================================
diff -u -ra20e9cd3ff7b1c1abcd3405b9007aaa4a9a15a53 -r240b188f86b1a819b9d8deba075589446e60b9fa
--- Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/PropertyClasses/ClosingStructuresCalculationsProperties.cs (.../ClosingStructuresCalculationsProperties.cs) (revision a20e9cd3ff7b1c1abcd3405b9007aaa4a9a15a53)
+++ Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/PropertyClasses/ClosingStructuresCalculationsProperties.cs (.../ClosingStructuresCalculationsProperties.cs) (revision 240b188f86b1a819b9d8deba075589446e60b9fa)
@@ -38,18 +38,13 @@
private const int namePropertyIndex = 1;
private const int codePropertyIndex = 2;
private const int groupPropertyIndex = 3;
- private const int contributionPropertyIndex = 4;
- private const int gravitationalAccelerationPropertyIndex = 5;
+ private const int gravitationalAccelerationPropertyIndex = 4;
- private const int cPropertyIndex = 6;
- private const int n2APropertyIndex = 7;
- private const int nPropertyIndex = 8;
+ private const int modelFactorOvertoppingFlowPropertyIndex = 5;
+ private const int modelFactorStorageVolumePropertyIndex = 6;
+ private const int modelFactorLongThresholdPropertyIndex = 7;
+ private const int modelFactorInflowVolumePropertyIndex = 8;
- private const int modelFactorOvertoppingFlowPropertyIndex = 9;
- private const int modelFactorStorageVolumePropertyIndex = 10;
- private const int modelFactorLongThresholdPropertyIndex = 11;
- private const int modelFactorInflowVolumePropertyIndex = 12;
-
///
/// Creates a new instance of .
///
@@ -59,11 +54,7 @@
{
NamePropertyIndex = namePropertyIndex,
CodePropertyIndex = codePropertyIndex,
- GroupPropertyIndex = groupPropertyIndex,
- ContributionPropertyIndex = contributionPropertyIndex,
- CPropertyIndex = cPropertyIndex,
- N2APropertyIndex = n2APropertyIndex,
- NPropertyIndex = nPropertyIndex
+ GroupPropertyIndex = groupPropertyIndex
}) {}
#region General
Index: Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/PropertyClasses/ClosingStructuresFailureMechanismProperties.cs
===================================================================
diff -u -rd480fcf3bc481eecc0568ee40d2dfa808505f8c2 -r240b188f86b1a819b9d8deba075589446e60b9fa
--- Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/PropertyClasses/ClosingStructuresFailureMechanismProperties.cs (.../ClosingStructuresFailureMechanismProperties.cs) (revision d480fcf3bc481eecc0568ee40d2dfa808505f8c2)
+++ Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/PropertyClasses/ClosingStructuresFailureMechanismProperties.cs (.../ClosingStructuresFailureMechanismProperties.cs) (revision 240b188f86b1a819b9d8deba075589446e60b9fa)
@@ -21,12 +21,10 @@
using System;
using System.Collections.Generic;
-using Core.Common.Base.Data;
using Core.Common.Util.Attributes;
using Core.Gui.Attributes;
using Core.Gui.PropertyBag;
using Riskeer.ClosingStructures.Data;
-using Riskeer.ClosingStructures.Forms.Properties;
using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources;
namespace Riskeer.ClosingStructures.Forms.PropertyClasses
@@ -69,18 +67,6 @@
},
{
nameof(Group), constructionProperties.GroupPropertyIndex
- },
- {
- nameof(Contribution), constructionProperties.ContributionPropertyIndex
- },
- {
- nameof(C), constructionProperties.CPropertyIndex
- },
- {
- nameof(N2A), constructionProperties.N2APropertyIndex
- },
- {
- nameof(N), constructionProperties.NPropertyIndex
}
};
}
@@ -98,25 +84,6 @@
///
public class ConstructionProperties
{
- #region Length effect parameters
-
- ///
- /// Gets or sets the property index for .
- ///
- public int CPropertyIndex { get; set; }
-
- ///
- /// Gets or sets the property index for .
- ///
- public int N2APropertyIndex { get; set; }
-
- ///
- /// Gets or sets the property index for .
- ///
- public int NPropertyIndex { get; set; }
-
- #endregion
-
#region General
///
@@ -134,59 +101,9 @@
///
public int GroupPropertyIndex { get; set; }
- ///
- /// Gets or sets the property index for .
- ///
- public int ContributionPropertyIndex { get; set; }
-
#endregion
}
- #region Length effect parameters
-
- [DynamicPropertyOrder]
- [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_LengthEffect))]
- [ResourcesDisplayName(typeof(Resources), nameof(Resources.ClosingStructuresFailureMechanismProperties_C_DisplayName))]
- [ResourcesDescription(typeof(Resources), nameof(Resources.ClosingStructuresFailureMechanismProperties_C_Description))]
- public RoundedDouble C
- {
- get
- {
- return data.GeneralInput.C;
- }
- }
-
- [DynamicPropertyOrder]
- [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_LengthEffect))]
- [ResourcesDisplayName(typeof(Resources), nameof(Resources.ClosingStructuresFailureMechanismProperties_N2A_DisplayName))]
- [ResourcesDescription(typeof(Resources), nameof(Resources.ClosingStructuresFailureMechanismProperties_N2A_Description))]
- public int N2A
- {
- get
- {
- return data.GeneralInput.N2A;
- }
- set
- {
- data.GeneralInput.N2A = value;
- data.NotifyObservers();
- }
- }
-
- [DynamicPropertyOrder]
- [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_LengthEffect))]
- [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_N_Rounded_DisplayName))]
- [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_N_Rounded_Description))]
- public RoundedDouble N
- {
- get
- {
- return new RoundedDouble(2, data.GeneralInput.N);
- }
- }
-
- #endregion
-
#region General
[DynamicPropertyOrder]
@@ -225,18 +142,6 @@
}
}
- [DynamicPropertyOrder]
- [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))]
- [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_Contribution_DisplayName))]
- [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_Contribution_Description))]
- public double Contribution
- {
- get
- {
- return data.Contribution;
- }
- }
-
#endregion
}
}
\ No newline at end of file
Index: Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/PropertyClasses/ClosingStructuresFailurePathProperties.cs
===================================================================
diff -u -ra20e9cd3ff7b1c1abcd3405b9007aaa4a9a15a53 -r240b188f86b1a819b9d8deba075589446e60b9fa
--- Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/PropertyClasses/ClosingStructuresFailurePathProperties.cs (.../ClosingStructuresFailurePathProperties.cs) (revision a20e9cd3ff7b1c1abcd3405b9007aaa4a9a15a53)
+++ Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/PropertyClasses/ClosingStructuresFailurePathProperties.cs (.../ClosingStructuresFailurePathProperties.cs) (revision 240b188f86b1a819b9d8deba075589446e60b9fa)
@@ -20,7 +20,11 @@
// All rights reserved.
using System;
+using Core.Common.Base.Data;
+using Core.Common.Util.Attributes;
+using Core.Gui.Attributes;
using Riskeer.ClosingStructures.Data;
+using Riskeer.ClosingStructures.Forms.Properties;
using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources;
namespace Riskeer.ClosingStructures.Forms.PropertyClasses
@@ -48,11 +52,68 @@
{
NamePropertyIndex = namePropertyIndex,
CodePropertyIndex = codePropertyIndex,
- GroupPropertyIndex = groupPropertyIndex,
- ContributionPropertyIndex = contributionPropertyIndex,
- CPropertyIndex = cPropertyIndex,
- N2APropertyIndex = n2APropertyIndex,
- NPropertyIndex = nPropertyIndex
+ GroupPropertyIndex = groupPropertyIndex
}) {}
+
+ #region General
+
+ [PropertyOrder(contributionPropertyIndex)]
+ [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))]
+ [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_Contribution_DisplayName))]
+ [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_Contribution_Description))]
+ public double Contribution
+ {
+ get
+ {
+ return data.Contribution;
+ }
+ }
+
+ #endregion
+
+ #region Length effect parameters
+
+ [PropertyOrder(cPropertyIndex)]
+ [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_LengthEffect))]
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.ClosingStructuresFailurePathProperties_C_DisplayName))]
+ [ResourcesDescription(typeof(Resources), nameof(Resources.ClosingStructuresFailurePathProperties_C_Description))]
+ public RoundedDouble C
+ {
+ get
+ {
+ return data.GeneralInput.C;
+ }
+ }
+
+ [PropertyOrder(n2APropertyIndex)]
+ [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_LengthEffect))]
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.ClosingStructuresFailurePathProperties_N2A_DisplayName))]
+ [ResourcesDescription(typeof(Resources), nameof(Resources.ClosingStructuresFailurePathProperties_N2A_Description))]
+ public int N2A
+ {
+ get
+ {
+ return data.GeneralInput.N2A;
+ }
+ set
+ {
+ data.GeneralInput.N2A = value;
+ data.NotifyObservers();
+ }
+ }
+
+ [PropertyOrder(nPropertyIndex)]
+ [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_LengthEffect))]
+ [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_N_Rounded_DisplayName))]
+ [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_N_Rounded_Description))]
+ public RoundedDouble N
+ {
+ get
+ {
+ return new RoundedDouble(2, data.GeneralInput.N);
+ }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Index: Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresCalculationsPropertiesTest.cs
===================================================================
diff -u -rb622ffe6a4bbd1f061efde51531949097906187f -r240b188f86b1a819b9d8deba075589446e60b9fa
--- Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresCalculationsPropertiesTest.cs (.../ClosingStructuresCalculationsPropertiesTest.cs) (revision b622ffe6a4bbd1f061efde51531949097906187f)
+++ Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresCalculationsPropertiesTest.cs (.../ClosingStructuresCalculationsPropertiesTest.cs) (revision 240b188f86b1a819b9d8deba075589446e60b9fa)
@@ -25,7 +25,6 @@
using NUnit.Framework;
using Riskeer.ClosingStructures.Data;
using Riskeer.ClosingStructures.Forms.PropertyClasses;
-using Riskeer.Common.Data.TestUtil;
namespace Riskeer.ClosingStructures.Forms.Test.PropertyClasses
{
@@ -35,18 +34,13 @@
private const int namePropertyIndex = 0;
private const int codePropertyIndex = 1;
private const int groupPropertyIndex = 2;
- private const int contributionPropertyIndex = 3;
- private const int gravitationalAccelerationPropertyIndex = 4;
+ private const int gravitationalAccelerationPropertyIndex = 3;
- private const int cPropertyIndex = 5;
- private const int n2APropertyIndex = 6;
- private const int nPropertyIndex = 7;
+ private const int modelFactorOvertoppingFlowPropertyIndex = 4;
+ private const int modelFactorStorageVolumePropertyIndex = 5;
+ private const int modelFactorLongThresholdPropertyIndex = 6;
+ private const int modelFactorInflowVolumePropertyIndex = 7;
- private const int modelFactorOvertoppingFlowPropertyIndex = 8;
- private const int modelFactorStorageVolumePropertyIndex = 9;
- private const int modelFactorLongThresholdPropertyIndex = 10;
- private const int modelFactorInflowVolumePropertyIndex = 11;
-
[Test]
public void Constructor_DataNull_ThrowArgumentNullException()
{
@@ -73,17 +67,11 @@
Assert.AreEqual(failureMechanism.Name, properties.Name);
Assert.AreEqual(failureMechanism.Code, properties.Code);
Assert.AreEqual(failureMechanism.Group, properties.Group);
- Assert.AreEqual(failureMechanism.Contribution, properties.Contribution);
GeneralClosingStructuresInput generalInput = failureMechanism.GeneralInput;
Assert.AreEqual(generalInput.GravitationalAcceleration,
properties.GravitationalAcceleration);
- Assert.AreEqual(generalInput.C, properties.C);
- Assert.AreEqual(generalInput.N2A, properties.N2A);
- Assert.AreEqual(2, properties.N.NumberOfDecimalPlaces);
- Assert.AreEqual(generalInput.N, properties.N, properties.N.GetAccuracy());
-
Assert.AreEqual(generalInput.ModelFactorOvertoppingFlow.Mean, properties.ModelFactorOvertoppingFlow.Mean);
Assert.AreEqual(generalInput.ModelFactorOvertoppingFlow.StandardDeviation, properties.ModelFactorOvertoppingFlow.StandardDeviation);
Assert.AreEqual(generalInput.ModelFactorStorageVolume.Mean, properties.ModelFactorStorageVolume.Mean);
@@ -101,11 +89,10 @@
// Assert
const string generalCategory = "Algemeen";
- const string lengthEffectCategory = "Lengte-effect parameters";
const string modelSettingsCategory = "Modelinstellingen";
PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties);
- Assert.AreEqual(12, dynamicProperties.Count);
+ Assert.AreEqual(8, dynamicProperties.Count);
PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex];
PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty,
@@ -128,40 +115,13 @@
"De groep waar het toetsspoor toe behoort.",
true);
- PropertyDescriptor contributionProperty = dynamicProperties[contributionPropertyIndex];
- PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(contributionProperty,
- generalCategory,
- "Faalkansbijdrage [%]",
- "Procentuele bijdrage van dit toetsspoor aan de totale overstromingskans van het traject.",
- true);
-
PropertyDescriptor gravitationalAccelerationProperty = dynamicProperties[gravitationalAccelerationPropertyIndex];
PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(gravitationalAccelerationProperty,
generalCategory,
"Valversnelling [m/s²]",
"Valversnelling.",
true);
- PropertyDescriptor cProperty = dynamicProperties[cPropertyIndex];
- PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(cProperty,
- lengthEffectCategory,
- "C [-]",
- "De parameter 'C' die gebruikt wordt om het lengte-effect te berekenen.",
- true);
-
- PropertyDescriptor n2AProperty = dynamicProperties[n2APropertyIndex];
- PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(n2AProperty,
- lengthEffectCategory,
- "2NA [-]",
- "De parameter '2NA' die gebruikt wordt om het lengte-effect te berekenen.");
-
- PropertyDescriptor nProperty = dynamicProperties[nPropertyIndex];
- PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nProperty,
- lengthEffectCategory,
- "N* [-]",
- "De parameter 'N' die gebruikt wordt om het lengte-effect mee te nemen in de beoordeling (afgerond).",
- true);
-
PropertyDescriptor modelFactorOvertoppingFlowProperty = dynamicProperties[modelFactorOvertoppingFlowPropertyIndex];
Assert.IsInstanceOf(modelFactorOvertoppingFlowProperty.Converter);
PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(modelFactorOvertoppingFlowProperty,
Index: Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresFailureMechanismPropertiesTest.cs
===================================================================
diff -u -r945014b806c33b0ae900efeeac26b843f683b1c2 -r240b188f86b1a819b9d8deba075589446e60b9fa
--- Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresFailureMechanismPropertiesTest.cs (.../ClosingStructuresFailureMechanismPropertiesTest.cs) (revision 945014b806c33b0ae900efeeac26b843f683b1c2)
+++ Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresFailureMechanismPropertiesTest.cs (.../ClosingStructuresFailureMechanismPropertiesTest.cs) (revision 240b188f86b1a819b9d8deba075589446e60b9fa)
@@ -21,27 +21,19 @@
using System;
using System.ComponentModel;
-using Core.Common.Base;
-using Core.Common.TestUtil;
using Core.Gui.PropertyBag;
using Core.Gui.TestUtil;
using NUnit.Framework;
-using Rhino.Mocks;
using Riskeer.ClosingStructures.Data;
using Riskeer.ClosingStructures.Forms.PropertyClasses;
-using Riskeer.Common.Data.TestUtil;
namespace Riskeer.ClosingStructures.Forms.Test.PropertyClasses
{
public class ClosingStructuresFailureMechanismPropertiesTest
{
- private const int namePropertyIndex = 6;
- private const int codePropertyIndex = 5;
- private const int groupPropertyIndex = 4;
- private const int contributionPropertyIndex = 3;
- private const int cPropertyIndex = 2;
- private const int n2APropertyIndex = 1;
- private const int nPropertyIndex = 0;
+ private const int namePropertyIndex = 2;
+ private const int codePropertyIndex = 1;
+ private const int groupPropertyIndex = 0;
[Test]
public void Constructor_DataNull_ThrowArgumentNullException()
@@ -80,14 +72,6 @@
Assert.AreEqual(failureMechanism.Name, properties.Name);
Assert.AreEqual(failureMechanism.Code, properties.Code);
Assert.AreEqual(failureMechanism.Group, properties.Group);
- Assert.AreEqual(failureMechanism.Contribution, properties.Contribution);
-
- GeneralClosingStructuresInput generalInput = failureMechanism.GeneralInput;
-
- Assert.AreEqual(generalInput.C, properties.C);
- Assert.AreEqual(generalInput.N2A, properties.N2A);
- Assert.AreEqual(2, properties.N.NumberOfDecimalPlaces);
- Assert.AreEqual(generalInput.N, properties.N, properties.N.GetAccuracy());
}
[Test]
@@ -98,19 +82,14 @@
{
NamePropertyIndex = namePropertyIndex,
CodePropertyIndex = codePropertyIndex,
- GroupPropertyIndex = groupPropertyIndex,
- ContributionPropertyIndex = contributionPropertyIndex,
- CPropertyIndex = cPropertyIndex,
- N2APropertyIndex = n2APropertyIndex,
- NPropertyIndex = nPropertyIndex
+ GroupPropertyIndex = groupPropertyIndex
});
// Assert
const string generalCategory = "Algemeen";
- const string lengthEffectCategory = "Lengte-effect parameters";
PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties);
- Assert.AreEqual(7, dynamicProperties.Count);
+ Assert.AreEqual(3, dynamicProperties.Count);
PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex];
PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty,
@@ -132,86 +111,6 @@
"Groep",
"De groep waar het toetsspoor toe behoort.",
true);
-
- PropertyDescriptor contributionProperty = dynamicProperties[contributionPropertyIndex];
- PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(contributionProperty,
- generalCategory,
- "Faalkansbijdrage [%]",
- "Procentuele bijdrage van dit toetsspoor aan de totale overstromingskans van het traject.",
- true);
-
- PropertyDescriptor cProperty = dynamicProperties[cPropertyIndex];
- PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(cProperty,
- lengthEffectCategory,
- "C [-]",
- "De parameter 'C' die gebruikt wordt om het lengte-effect te berekenen.",
- true);
-
- PropertyDescriptor n2AProperty = dynamicProperties[n2APropertyIndex];
- PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(n2AProperty,
- lengthEffectCategory,
- "2NA [-]",
- "De parameter '2NA' die gebruikt wordt om het lengte-effect te berekenen.");
-
- PropertyDescriptor nProperty = dynamicProperties[nPropertyIndex];
- PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nProperty,
- lengthEffectCategory,
- "N* [-]",
- "De parameter 'N' die gebruikt wordt om het lengte-effect mee te nemen in de beoordeling (afgerond).",
- true);
}
-
- [Test]
- [SetCulture("nl-NL")]
- [TestCase(-1)]
- [TestCase(-20)]
- [TestCase(41)]
- public void N2A_SetInvalidValue_ThrowsArgumentOutOfRangeExceptionNoNotifications(int newN2A)
- {
- // Setup
- var mocks = new MockRepository();
- var observer = mocks.StrictMock();
- mocks.ReplayAll();
-
- var failureMechanism = new ClosingStructuresFailureMechanism();
- failureMechanism.Attach(observer);
-
- var properties = new ClosingStructuresFailureMechanismProperties(failureMechanism, new ClosingStructuresFailureMechanismProperties.ConstructionProperties());
-
- // Call
- void Call() => properties.N2A = newN2A;
-
- // Assert
- const string expectedMessage = "De waarde voor 'N2A' moet in het bereik [0, 40] liggen.";
- TestHelper.AssertThrowsArgumentExceptionAndTestMessage(Call, expectedMessage);
-
- mocks.VerifyAll();
- }
-
- [Test]
- [TestCase(1)]
- [TestCase(10)]
- [TestCase(20)]
- public void N2A_SetValidValue_UpdateDataAndNotifyObservers(int newN2A)
- {
- // Setup
- var mocks = new MockRepository();
- var observer = mocks.StrictMock();
- observer.Expect(o => o.UpdateObserver());
- mocks.ReplayAll();
-
- var failureMechanism = new ClosingStructuresFailureMechanism();
- failureMechanism.Attach(observer);
-
- var properties = new ClosingStructuresFailureMechanismProperties(failureMechanism, new ClosingStructuresFailureMechanismProperties.ConstructionProperties());
-
- // Call
- properties.N2A = newN2A;
-
- // Assert
- Assert.AreEqual(newN2A, failureMechanism.GeneralInput.N2A, failureMechanism.GeneralInput.N2A);
-
- mocks.VerifyAll();
- }
}
}
\ No newline at end of file
Index: Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresFailurePathPropertiesTest.cs
===================================================================
diff -u -rb622ffe6a4bbd1f061efde51531949097906187f -r240b188f86b1a819b9d8deba075589446e60b9fa
--- Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresFailurePathPropertiesTest.cs (.../ClosingStructuresFailurePathPropertiesTest.cs) (revision b622ffe6a4bbd1f061efde51531949097906187f)
+++ Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresFailurePathPropertiesTest.cs (.../ClosingStructuresFailurePathPropertiesTest.cs) (revision 240b188f86b1a819b9d8deba075589446e60b9fa)
@@ -19,9 +19,13 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using System;
using System.ComponentModel;
+using Core.Common.Base;
+using Core.Common.TestUtil;
using Core.Gui.TestUtil;
using NUnit.Framework;
+using Rhino.Mocks;
using Riskeer.ClosingStructures.Data;
using Riskeer.ClosingStructures.Forms.PropertyClasses;
using Riskeer.Common.Data.TestUtil;
@@ -124,5 +128,58 @@
"De parameter 'N' die gebruikt wordt om het lengte-effect mee te nemen in de beoordeling (afgerond).",
true);
}
+
+ [Test]
+ [SetCulture("nl-NL")]
+ [TestCase(-1)]
+ [TestCase(-20)]
+ [TestCase(41)]
+ public void N2A_SetInvalidValue_ThrowsArgumentOutOfRangeExceptionNoNotifications(int newN2A)
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var observer = mocks.StrictMock();
+ mocks.ReplayAll();
+
+ var failureMechanism = new ClosingStructuresFailureMechanism();
+ failureMechanism.Attach(observer);
+
+ var properties = new ClosingStructuresFailurePathProperties(failureMechanism);
+
+ // Call
+ void Call() => properties.N2A = newN2A;
+
+ // Assert
+ const string expectedMessage = "De waarde voor 'N2A' moet in het bereik [0, 40] liggen.";
+ TestHelper.AssertThrowsArgumentExceptionAndTestMessage(Call, expectedMessage);
+
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ [TestCase(1)]
+ [TestCase(10)]
+ [TestCase(20)]
+ public void N2A_SetValidValue_UpdateDataAndNotifyObservers(int newN2A)
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var observer = mocks.StrictMock();
+ observer.Expect(o => o.UpdateObserver());
+ mocks.ReplayAll();
+
+ var failureMechanism = new ClosingStructuresFailureMechanism();
+ failureMechanism.Attach(observer);
+
+ var properties = new ClosingStructuresFailurePathProperties(failureMechanism);
+
+ // Call
+ properties.N2A = newN2A;
+
+ // Assert
+ Assert.AreEqual(newN2A, failureMechanism.GeneralInput.N2A, failureMechanism.GeneralInput.N2A);
+
+ mocks.VerifyAll();
+ }
}
}
\ No newline at end of file