Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailureMechanismProperties.cs =================================================================== diff -u -r4ca0389a47c2979f47d826f86a84e2e9f7a6f7f6 -rdea52353c1070458ac644d22bd81e517b4ac5bbe --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailureMechanismProperties.cs (.../StabilityStoneCoverFailureMechanismProperties.cs) (revision 4ca0389a47c2979f47d826f86a84e2e9f7a6f7f6) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailureMechanismProperties.cs (.../StabilityStoneCoverFailureMechanismProperties.cs) (revision dea52353c1070458ac644d22bd81e517b4ac5bbe) @@ -55,7 +55,7 @@ #region Length effect parameters [DynamicVisible] - [PropertyOrder(6)] + [PropertyOrder(7)] [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_LengthEffect))] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.FailureMechanism_N_DisplayName))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.FailureMechanism_N_Description))] @@ -86,7 +86,8 @@ private bool ShouldHidePropertyWhenFailureMechanismIrrelevant(string propertyName) { - return nameof(Blocks).Equals(propertyName) + return nameof(Contribution).Equals(propertyName) + || nameof(Blocks).Equals(propertyName) || nameof(Columns).Equals(propertyName) || nameof(N).Equals(propertyName); } @@ -117,8 +118,21 @@ } } + [DynamicVisible] [PropertyOrder(3)] [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.FailureMechanism_Contribution_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.FailureMechanism_Contribution_Description))] + public double Contribution + { + get + { + return data.Contribution; + } + } + + [PropertyOrder(4)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.FailureMechanism_IsRelevant_DisplayName))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.FailureMechanism_IsRelevant_Description))] public bool IsRelevant @@ -134,7 +148,7 @@ #region Model settings [DynamicVisible] - [PropertyOrder(4)] + [PropertyOrder(5)] [TypeConverter(typeof(ExpandableObjectConverter))] [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_ModelSettings))] [ResourcesDisplayName(typeof(Resources), nameof(Resources.StabilityStoneCoverWaveConditions_Blocks_DisplayName))] @@ -151,7 +165,7 @@ } [DynamicVisible] - [PropertyOrder(5)] + [PropertyOrder(6)] [TypeConverter(typeof(ExpandableObjectConverter))] [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_ModelSettings))] [ResourcesDisplayName(typeof(Resources), nameof(Resources.StabilityStoneCoverWaveConditions_Columns_DisplayName))] Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailureMechanismPropertiesTest.cs =================================================================== diff -u -r4ca0389a47c2979f47d826f86a84e2e9f7a6f7f6 -rdea52353c1070458ac644d22bd81e517b4ac5bbe --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailureMechanismPropertiesTest.cs (.../StabilityStoneCoverFailureMechanismPropertiesTest.cs) (revision 4ca0389a47c2979f47d826f86a84e2e9f7a6f7f6) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailureMechanismPropertiesTest.cs (.../StabilityStoneCoverFailureMechanismPropertiesTest.cs) (revision dea52353c1070458ac644d22bd81e517b4ac5bbe) @@ -73,10 +73,13 @@ Assert.AreSame(failureMechanism, properties.Data); Assert.AreEqual(failureMechanism.Name, properties.Name); Assert.AreEqual(failureMechanism.Code, properties.Code); + Assert.AreEqual(failureMechanism.Contribution, properties.Contribution); Assert.AreEqual(isRelevant, properties.IsRelevant); - Assert.AreSame(failureMechanism.GeneralInput.GeneralBlocksWaveConditionsInput, properties.Blocks.Data); - Assert.AreSame(failureMechanism.GeneralInput.GeneralColumnsWaveConditionsInput, properties.Columns.Data); - Assert.AreEqual(failureMechanism.GeneralInput.N, properties.N); + + GeneralStabilityStoneCoverWaveConditionsInput generalInput = failureMechanism.GeneralInput; + Assert.AreSame(generalInput.GeneralBlocksWaveConditionsInput, properties.Blocks.Data); + Assert.AreSame(generalInput.GeneralColumnsWaveConditionsInput, properties.Columns.Data); + Assert.AreEqual(generalInput.N, properties.N); } [Test] @@ -109,7 +112,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(6, dynamicProperties.Count); + Assert.AreEqual(7, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string modelSettingsCateogry = "Modelinstellingen"; @@ -129,28 +132,35 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor isRelevantProperty = dynamicProperties[2]; + PropertyDescriptor contributionProperty = dynamicProperties[2]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(contributionProperty, + generalCategory, + "Faalkansbijdrage [%]", + "Procentuele bijdrage van dit toetsspoor aan de totale overstromingskans van het traject.", + true); + + PropertyDescriptor isRelevantProperty = dynamicProperties[3]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(isRelevantProperty, generalCategory, "Is relevant", "Geeft aan of dit toetsspoor relevant is of niet.", true); - PropertyDescriptor blocksProperty = dynamicProperties[3]; + PropertyDescriptor blocksProperty = dynamicProperties[4]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(blocksProperty, modelSettingsCateogry, "Blokken", "De modelinstellingen voor het berekenen van golfcondities voor blokken.", true); - PropertyDescriptor columnsProperty = dynamicProperties[4]; + PropertyDescriptor columnsProperty = dynamicProperties[5]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(columnsProperty, modelSettingsCateogry, "Zuilen", "De modelinstellingen voor het berekenen van golfcondities voor zuilen.", true); - PropertyDescriptor nProperty = dynamicProperties[5]; + PropertyDescriptor nProperty = dynamicProperties[6]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nProperty, lengthEffectCategory, "N [-]", @@ -214,6 +224,7 @@ Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.Code))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.IsRelevant))); + Assert.AreEqual(isRelevant, properties.DynamicVisibleValidationMethod(nameof(properties.Contribution))); Assert.AreEqual(isRelevant, properties.DynamicVisibleValidationMethod(nameof(properties.Blocks))); Assert.AreEqual(isRelevant, properties.DynamicVisibleValidationMethod(nameof(properties.Columns))); Assert.AreEqual(isRelevant, properties.DynamicVisibleValidationMethod(nameof(properties.N)));