Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresFailureMechanismPropertiesTest.cs =================================================================== diff -u -r58294671cbbde72fff978212cf62d3ce528169bd -r5364d9cba57e4d0eb5adeeef11648499fcc72f01 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresFailureMechanismPropertiesTest.cs (.../ClosingStructuresFailureMechanismPropertiesTest.cs) (revision 58294671cbbde72fff978212cf62d3ce528169bd) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresFailureMechanismPropertiesTest.cs (.../ClosingStructuresFailureMechanismPropertiesTest.cs) (revision 5364d9cba57e4d0eb5adeeef11648499fcc72f01) @@ -339,8 +339,7 @@ { // Setup var mocks = new MockRepository(); - IFailureMechanismPropertyChangeHandler changeHandler = - mocks.Stub>(); + var changeHandler = mocks.Stub>(); mocks.ReplayAll(); var properties = new ClosingStructuresFailureMechanismProperties( @@ -364,15 +363,16 @@ Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.ModelFactorInflowVolume))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); + + mocks.VerifyAll(); } [Test] public void DynamicVisibleValidationMethod_ForIrrelevantFailureMechanism_ReturnExpectedVisibility() { // Setup var mocks = new MockRepository(); - IFailureMechanismPropertyChangeHandler changeHandler = - mocks.Stub>(); + var changeHandler = mocks.Stub>(); mocks.ReplayAll(); var properties = new ClosingStructuresFailureMechanismProperties( @@ -396,6 +396,8 @@ Assert.IsFalse(properties.DynamicVisibleValidationMethod(nameof(properties.ModelFactorInflowVolume))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); + + mocks.VerifyAll(); } } } \ No newline at end of file Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneErosionFailureMechanismPropertiesTest.cs =================================================================== diff -u -r013749240d7261d436b3b7a4424d4831a5441e55 -r5364d9cba57e4d0eb5adeeef11648499fcc72f01 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneErosionFailureMechanismPropertiesTest.cs (.../DuneErosionFailureMechanismPropertiesTest.cs) (revision 013749240d7261d436b3b7a4424d4831a5441e55) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneErosionFailureMechanismPropertiesTest.cs (.../DuneErosionFailureMechanismPropertiesTest.cs) (revision 5364d9cba57e4d0eb5adeeef11648499fcc72f01) @@ -294,8 +294,7 @@ { // Setup var mocks = new MockRepository(); - IFailureMechanismPropertyChangeHandler changeHandler = - mocks.Stub>(); + var changeHandler = mocks.Stub>(); mocks.ReplayAll(); var properties = new DuneErosionFailureMechanismProperties( @@ -312,15 +311,16 @@ Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.IsRelevant))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); + + mocks.VerifyAll(); } [Test] public void DynamicVisibleValidationMethod_ForIrrelevantFailureMechanism_ReturnExpectedVisibility() { // Setup var mocks = new MockRepository(); - IFailureMechanismPropertyChangeHandler changeHandler = - mocks.Stub>(); + var changeHandler = mocks.Stub>(); mocks.ReplayAll(); var properties = new DuneErosionFailureMechanismProperties( @@ -337,6 +337,8 @@ Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.IsRelevant))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); + + mocks.VerifyAll(); } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs =================================================================== diff -u -ra0500683a36518c9b3cd5bb74fee36b858dda96d -r5364d9cba57e4d0eb5adeeef11648499fcc72f01 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs) (revision a0500683a36518c9b3cd5bb74fee36b858dda96d) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs) (revision 5364d9cba57e4d0eb5adeeef11648499fcc72f01) @@ -360,6 +360,8 @@ Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.FshallowModelFactor))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); + + mocks.VerifyAll(); } [Test] @@ -390,6 +392,8 @@ Assert.IsFalse(properties.DynamicVisibleValidationMethod(nameof(properties.FshallowModelFactor))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); + + mocks.VerifyAll(); } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsFailureMechanismPropertiesTest.cs =================================================================== diff -u -ra322a3fd977d26be5370bacd52db52c7c5f70614 -r5364d9cba57e4d0eb5adeeef11648499fcc72f01 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsFailureMechanismPropertiesTest.cs (.../GrassCoverErosionOutwardsFailureMechanismPropertiesTest.cs) (revision a322a3fd977d26be5370bacd52db52c7c5f70614) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsFailureMechanismPropertiesTest.cs (.../GrassCoverErosionOutwardsFailureMechanismPropertiesTest.cs) (revision 5364d9cba57e4d0eb5adeeef11648499fcc72f01) @@ -309,6 +309,8 @@ Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.LengthEffect))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); + + mocks.VerifyAll(); } [Test] @@ -336,6 +338,8 @@ Assert.IsFalse(properties.DynamicVisibleValidationMethod(nameof(properties.LengthEffect))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); + + mocks.VerifyAll(); } } } \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresFailureMechanismPropertiesTest.cs =================================================================== diff -u -rdcf1ab6a4dc050223986ee003577d22c36fb6bc4 -r5364d9cba57e4d0eb5adeeef11648499fcc72f01 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresFailureMechanismPropertiesTest.cs (.../HeightStructuresFailureMechanismPropertiesTest.cs) (revision dcf1ab6a4dc050223986ee003577d22c36fb6bc4) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresFailureMechanismPropertiesTest.cs (.../HeightStructuresFailureMechanismPropertiesTest.cs) (revision 5364d9cba57e4d0eb5adeeef11648499fcc72f01) @@ -329,6 +329,8 @@ Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.ModelFactorStorageVolume))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); + + mocks.VerifyAll(); } [Test] @@ -356,6 +358,8 @@ Assert.IsFalse(properties.DynamicVisibleValidationMethod(nameof(properties.ModelFactorStorageVolume))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); + + mocks.VerifyAll(); } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/StandAloneFailureMechanismContextPropertiesTest.cs =================================================================== diff -u -r5dcd3e55f955420e3fc3ed3c1d6a94dc624d0056 -r5364d9cba57e4d0eb5adeeef11648499fcc72f01 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/StandAloneFailureMechanismContextPropertiesTest.cs (.../StandAloneFailureMechanismContextPropertiesTest.cs) (revision 5dcd3e55f955420e3fc3ed3c1d6a94dc624d0056) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/StandAloneFailureMechanismContextPropertiesTest.cs (.../StandAloneFailureMechanismContextPropertiesTest.cs) (revision 5364d9cba57e4d0eb5adeeef11648499fcc72f01) @@ -96,7 +96,7 @@ const string generalCategory = "Algemeen"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(11, dynamicProperties.Count); + Assert.AreEqual(3, dynamicProperties.Count); PropertyDescriptor nameProperty = dynamicProperties[0]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingFailureMechanismContextPropertiesTest.cs =================================================================== diff -u -r386bafbe025b31f2b1351a7aa67161119c9c9d76 -r5364d9cba57e4d0eb5adeeef11648499fcc72f01 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingFailureMechanismContextPropertiesTest.cs (.../PipingFailureMechanismContextPropertiesTest.cs) (revision 386bafbe025b31f2b1351a7aa67161119c9c9d76) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingFailureMechanismContextPropertiesTest.cs (.../PipingFailureMechanismContextPropertiesTest.cs) (revision 5364d9cba57e4d0eb5adeeef11648499fcc72f01) @@ -513,6 +513,8 @@ Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.SellmeijerModelFactor))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); + + mocks.VerifyAll(); } [Test] @@ -551,6 +553,8 @@ Assert.IsFalse(properties.DynamicVisibleValidationMethod(nameof(properties.SellmeijerModelFactor))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); + + mocks.VerifyAll(); } } } \ No newline at end of file Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailureMechanismPropertiesTest.cs =================================================================== diff -u -r29b6e326e4a729daa7f88c6a54b2fcd7c5e2af83 -r5364d9cba57e4d0eb5adeeef11648499fcc72f01 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailureMechanismPropertiesTest.cs (.../StabilityPointStructuresFailureMechanismPropertiesTest.cs) (revision 29b6e326e4a729daa7f88c6a54b2fcd7c5e2af83) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailureMechanismPropertiesTest.cs (.../StabilityPointStructuresFailureMechanismPropertiesTest.cs) (revision 5364d9cba57e4d0eb5adeeef11648499fcc72f01) @@ -345,6 +345,8 @@ Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.ModelFactorLoadEffect))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); + + mocks.VerifyAll(); } [Test] @@ -374,6 +376,8 @@ Assert.IsFalse(properties.DynamicVisibleValidationMethod(nameof(properties.ModelFactorLoadEffect))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); + + mocks.VerifyAll(); } } } \ No newline at end of file Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailureMechanismProperties.cs =================================================================== diff -u -r69eb8c7057601ce45297368b9281ea1e60980f28 -r5364d9cba57e4d0eb5adeeef11648499fcc72f01 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailureMechanismProperties.cs (.../StabilityStoneCoverFailureMechanismProperties.cs) (revision 69eb8c7057601ce45297368b9281ea1e60980f28) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailureMechanismProperties.cs (.../StabilityStoneCoverFailureMechanismProperties.cs) (revision 5364d9cba57e4d0eb5adeeef11648499fcc72f01) @@ -35,6 +35,22 @@ /// public class StabilityStoneCoverFailureMechanismProperties : ObjectProperties { + [DynamicVisibleValidationMethod] + public bool DynamicVisibleValidationMethod(string propertyName) + { + if (!data.IsRelevant && ShouldHidePropertyWhenFailureMechanismIrrelevant(propertyName)) + { + return false; + } + return true; + } + + private bool ShouldHidePropertyWhenFailureMechanismIrrelevant(string propertyName) + { + return nameof(Blocks).Equals(propertyName) + || nameof(Columns).Equals(propertyName); + } + #region General [PropertyOrder(1)] @@ -61,11 +77,24 @@ } } + [PropertyOrder(3)] + [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 + { + get + { + return data.IsRelevant; + } + } + #endregion #region Model settings - [PropertyOrder(3)] + [DynamicVisible] + [PropertyOrder(4)] [TypeConverter(typeof(ExpandableObjectConverter))] [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_ModelSettings))] [ResourcesDisplayName(typeof(Resources), nameof(Resources.StabilityStoneCoverWaveConditions_Blocks_DisplayName))] @@ -81,7 +110,8 @@ } } - [PropertyOrder(4)] + [DynamicVisible] + [PropertyOrder(5)] [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 -rec3281e9d98baa572ca092f702b942947a44dbfa -r5364d9cba57e4d0eb5adeeef11648499fcc72f01 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailureMechanismPropertiesTest.cs (.../StabilityStoneCoverFailureMechanismPropertiesTest.cs) (revision ec3281e9d98baa572ca092f702b942947a44dbfa) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailureMechanismPropertiesTest.cs (.../StabilityStoneCoverFailureMechanismPropertiesTest.cs) (revision 5364d9cba57e4d0eb5adeeef11648499fcc72f01) @@ -42,10 +42,15 @@ } [Test] - public void Data_SetNewStabilityStoneCoverFailureMechanismContext_ReturnCorrectPropertyValues() + [TestCase(true)] + [TestCase(false)] + public void Data_SetNewStabilityStoneCoverFailureMechanismContext_ReturnCorrectPropertyValues(bool isRelevant) { // Setup - var failureMechanism = new StabilityStoneCoverFailureMechanism(); + var failureMechanism = new StabilityStoneCoverFailureMechanism + { + IsRelevant = isRelevant + }; var properties = new StabilityStoneCoverFailureMechanismProperties(); // Call @@ -54,48 +59,150 @@ // Assert Assert.AreEqual(failureMechanism.Name, properties.Name); Assert.AreEqual(failureMechanism.Code, properties.Code); + Assert.AreEqual(isRelevant, properties.IsRelevant); Assert.AreSame(failureMechanism.GeneralInput.GeneralBlocksWaveConditionsInput, properties.Blocks.Data); Assert.AreSame(failureMechanism.GeneralInput.GeneralColumnsWaveConditionsInput, properties.Columns.Data); } [Test] - public void Constructor_Always_PropertiesHaveExpectedAttributesValues() + public void Constructor_IsRelevantTrue_PropertiesHaveExpectedAttributesValues() { // Call var properties = new StabilityStoneCoverFailureMechanismProperties { - Data = new StabilityStoneCoverFailureMechanism() + Data = new StabilityStoneCoverFailureMechanism + { + IsRelevant = true + } }; // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(4, dynamicProperties.Count); + Assert.AreEqual(5, dynamicProperties.Count); + const string generalCategory = "Algemeen"; + const string modelSettingsCateogry = "Modelinstellingen"; + PropertyDescriptor nameProperty = dynamicProperties[0]; - Assert.IsTrue(nameProperty.IsReadOnly); - Assert.AreEqual("Algemeen", nameProperty.Category); - Assert.AreEqual("Naam", nameProperty.DisplayName); - Assert.AreEqual("De naam van het toetsspoor.", nameProperty.Description); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, + generalCategory, + "Naam", + "De naam van het toetsspoor.", + true); PropertyDescriptor codeProperty = dynamicProperties[1]; - Assert.IsTrue(codeProperty.IsReadOnly); - Assert.AreEqual("Algemeen", codeProperty.Category); - Assert.AreEqual("Label", codeProperty.DisplayName); - Assert.AreEqual("Het label van het toetsspoor.", codeProperty.Description); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(codeProperty, + generalCategory, + "Label", + "Het label van het toetsspoor.", + true); - PropertyDescriptor blocksProperty = dynamicProperties[2]; - Assert.IsTrue(blocksProperty.IsReadOnly); + PropertyDescriptor isRelevantProperty = dynamicProperties[2]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(isRelevantProperty, + generalCategory, + "Is relevant", + "Geeft aan of dit toetsspoor relevant is of niet.", + true); + + PropertyDescriptor blocksProperty = dynamicProperties[3]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(blocksProperty, + modelSettingsCateogry, + "Blokken", + "De modelinstellingen voor het berekenen van golfcondities voor blokken.", + true); Assert.IsInstanceOf(blocksProperty.Converter); - Assert.AreEqual("Modelinstellingen", blocksProperty.Category); - Assert.AreEqual("Blokken", blocksProperty.DisplayName); - Assert.AreEqual("De modelinstellingen voor het berekenen van golfcondities voor blokken.", blocksProperty.Description); - PropertyDescriptor columnsProperty = dynamicProperties[3]; - Assert.IsTrue(columnsProperty.IsReadOnly); + PropertyDescriptor columnsProperty = dynamicProperties[4]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(columnsProperty, + modelSettingsCateogry, + "Zuilen", + "De modelinstellingen voor het berekenen van golfcondities voor zuilen.", + true); Assert.IsInstanceOf(columnsProperty.Converter); - Assert.AreEqual("Modelinstellingen", columnsProperty.Category); - Assert.AreEqual("Zuilen", columnsProperty.DisplayName); - Assert.AreEqual("De modelinstellingen voor het berekenen van golfcondities voor zuilen.", columnsProperty.Description); } + + [Test] + public void Constructor_IsRelevantFalse_PropertiesHaveExpectedAttributesValues() + { + // Call + var properties = new StabilityStoneCoverFailureMechanismProperties + { + Data = new StabilityStoneCoverFailureMechanism + { + IsRelevant = false + } + }; + + // Assert + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(3, dynamicProperties.Count); + + const string generalCategory = "Algemeen"; + + PropertyDescriptor nameProperty = dynamicProperties[0]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, + generalCategory, + "Naam", + "De naam van het toetsspoor.", + true); + + PropertyDescriptor codeProperty = dynamicProperties[1]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(codeProperty, + generalCategory, + "Label", + "Het label van het toetsspoor.", + true); + + PropertyDescriptor isRelevantProperty = dynamicProperties[2]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(isRelevantProperty, + generalCategory, + "Is relevant", + "Geeft aan of dit toetsspoor relevant is of niet.", + true); + } + + [Test] + public void DynamicVisibleValidationMethod_ForRelevantFailureMechanism_ReturnExpectedVisibility() + { + // Setup + var properties = new StabilityStoneCoverFailureMechanismProperties + { + Data = new StabilityStoneCoverFailureMechanism + { + IsRelevant = true + } + }; + + // Call & Assert + Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.Name))); + Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.Code))); + Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.IsRelevant))); + Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.Blocks))); + Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.Columns))); + + Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); + } + + [Test] + public void DynamicVisibleValidationMethod_ForIrrelevantFailureMechanism_ReturnExpectedVisibility() + { + // Setup + var properties = new StabilityStoneCoverFailureMechanismProperties + { + Data = new StabilityStoneCoverFailureMechanism + { + IsRelevant = false + } + }; + + // Call & Assert + Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.Name))); + Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.Code))); + Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.IsRelevant))); + Assert.IsFalse(properties.DynamicVisibleValidationMethod(nameof(properties.Blocks))); + Assert.IsFalse(properties.DynamicVisibleValidationMethod(nameof(properties.Columns))); + + Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); + } } } \ No newline at end of file