Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r76bf9c7fbdfb0822c5d7e6bb7ee221467ec8734b -r9f61d93bd5ff6bd9ffdf384d633d008ff43187cb --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 76bf9c7fbdfb0822c5d7e6bb7ee221467ec8734b) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 9f61d93bd5ff6bd9ffdf384d633d008ff43187cb) @@ -22,7 +22,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -1902,7 +1902,7 @@ } /// - /// Looks up a localized string similar to Modelfactor instromend volume. + /// Looks up a localized string similar to Modelfactor instromend volume.. /// public static string StructuresInputFailureMechanismContext_ModelFactorInflowVolume_Description { get { @@ -1956,7 +1956,7 @@ } /// - /// Looks up a localized string similar to Modelfactor voor onvolkomen stroming. + /// Looks up a localized string similar to Modelfactor voor onvolkomen stroming.. /// public static string StructuresInputFailureMechanismContext_ModelFactorSubCriticalFlow_Description { get { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx =================================================================== diff -u -r76bf9c7fbdfb0822c5d7e6bb7ee221467ec8734b -r9f61d93bd5ff6bd9ffdf384d633d008ff43187cb --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 76bf9c7fbdfb0822c5d7e6bb7ee221467ec8734b) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 9f61d93bd5ff6bd9ffdf384d633d008ff43187cb) @@ -743,7 +743,7 @@ Kritieke waarden - Modelfactor instromend volume + Modelfactor instromend volume. Modelfactor instromend volume [-] @@ -761,7 +761,7 @@ Modelfactor kombergend vermogen [-] - Modelfactor voor onvolkomen stroming + Modelfactor voor onvolkomen stroming. Modelfactor voor onvolkomen stroming [-] Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r71b9a121ae80ccb0e0498fabb944010e63c239b4 -r9f61d93bd5ff6bd9ffdf384d633d008ff43187cb --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 71b9a121ae80ccb0e0498fabb944010e63c239b4) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 9f61d93bd5ff6bd9ffdf384d633d008ff43187cb) @@ -120,6 +120,26 @@ } /// + /// Looks up a localized string similar to Modelfactor belastingeffect.. + /// + internal static string StabilityPointStructuresInputFailureMechanismContext_ModelFactorLoadEffect_Description { + get { + return ResourceManager.GetString("StabilityPointStructuresInputFailureMechanismContext_ModelFactorLoadEffect_Descri" + + "ption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Modelfactor belastingeffect [-]. + /// + internal static string StabilityPointStructuresInputFailureMechanismContext_ModelFactorLoadEffect_DisplayName { + get { + return ResourceManager.GetString("StabilityPointStructuresInputFailureMechanismContext_ModelFactorLoadEffect_Displa" + + "yName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Modificatiefactor voor de aard van de wand.. /// internal static string StabilityPointStructuresInputFailureMechanismContext_ModificationFactorDynamicOrImpulsivePressureComponent_Description { @@ -160,7 +180,7 @@ } /// - /// Looks up a localized string similar to N parameter van Rayleigh-N verdeling voor quotiënt van Hmax en Hs voor N golven.. + /// Looks up a localized string similar to N parameter van de Rayleigh-N verdeling voor het quotiënt van Hmax en Hs voor N golven.. /// internal static string StabilityPointStructuresInputFailureMechanismContext_WaveRatioMaxHN_Description { get { @@ -178,7 +198,7 @@ } /// - /// Looks up a localized string similar to Schaal parameter van Rayleigh-N verdeling voor quotiënt van Hmax en Hs voor N golven.. + /// Looks up a localized string similar to Schaal parameter van de Rayleigh-N verdeling voor het quotiënt van Hmax en Hs voor N golven.. /// internal static string StabilityPointStructuresInputFailureMechanismContext_WaveRatioMaxHStandardDeviation_Description { get { Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Properties/Resources.resx =================================================================== diff -u -r71b9a121ae80ccb0e0498fabb944010e63c239b4 -r9f61d93bd5ff6bd9ffdf384d633d008ff43187cb --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Properties/Resources.resx (.../Resources.resx) (revision 71b9a121ae80ccb0e0498fabb944010e63c239b4) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Properties/Resources.resx (.../Resources.resx) (revision 9f61d93bd5ff6bd9ffdf384d633d008ff43187cb) @@ -129,6 +129,12 @@ Modelfactor voor aanvaarbelasting [-] + + Modelfactor belastingeffect. + + + Modelfactor belastingeffect [-] + Modificatiefactor voor de aard van de wand. @@ -142,13 +148,13 @@ Modificatiefactor geometrie van de wand [-] - N parameter van Rayleigh-N verdeling voor quotiënt van Hmax en Hs voor N golven. + N parameter van de Rayleigh-N verdeling voor het quotiënt van Hmax en Hs voor N golven. Rayleigh-N N parameter [-] - Schaal parameter van Rayleigh-N verdeling voor quotiënt van Hmax en Hs voor N golven. + Schaal parameter van de Rayleigh-N verdeling voor het quotiënt van Hmax en Hs voor N golven. Rayleigh-N schaal parameter [-] Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailureMechanismContextPropertiesTest.cs =================================================================== diff -u --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailureMechanismContextPropertiesTest.cs (revision 0) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailureMechanismContextPropertiesTest.cs (revision 9f61d93bd5ff6bd9ffdf384d633d008ff43187cb) @@ -0,0 +1,253 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.ComponentModel; +using Core.Common.Base; +using Core.Common.Gui.PropertyBag; +using Core.Common.TestUtil; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.StabilityPointStructures.Forms.PresentationObjects; +using Ringtoets.StabilityPointStructures.Forms.PropertyClasses; + +namespace Ringtoets.StabilityPointStructures.Forms.Test.PropertyClasses +{ + [TestFixture] + public class StabilityPointStructuresFailureMechanismContextPropertiesTest + { + + private const int namePropertyIndex = 0; + private const int codePropertyIndex = 1; + private const int gravitationalAccelerationPropertyIndex = 2; + private const int lengthEffectPropertyIndex = 3; + private const int modelFactorStorageVolumePropertyIndex = 4; + private const int modelFactorSubCriticalFlowPropertyIndex = 5; + private const int modelFactorCollisionLoadPropertyIndex = 6; + private const int modelFactorLoadEffectPropertyIndex = 7; + private const int modelFactorInflowVolumePropertyIndex = 8; + private const int modificationFactorWavesSlowlyVaryingPressureComponentPropertyIndex = 9; + private const int modificationFactorDynamicOrImpulsivePressureComponentPropertyIndex = 10; + private const int waveRatioMaxHNPropertyIndex = 11; + private const int waveRatioMaxHStandardDeviationPropertyIndex = 12; + private MockRepository mockRepository; + + [SetUp] + public void SetUp() + { + mockRepository = new MockRepository(); + } + + [Test] + public void Constructor_ExpectedValues() + { + // Call + var properties = new StabilityPointStructuresFailureMechanismContextProperties(); + + // Assert + Assert.IsInstanceOf>(properties); + Assert.IsNull(properties.Data); + } + + [Test] + public void Data_SetNewFailureMechanismContextInstance_ReturnCorrectPropertyValues() + { + // Setup + var assessmentSection = mockRepository.Stub(); + mockRepository.ReplayAll(); + + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + var properties = new StabilityPointStructuresFailureMechanismContextProperties(); + + // Call + properties.Data = new StabilityPointStructuresFailureMechanismContext(failureMechanism, assessmentSection); + + // Assert + Assert.AreEqual("Kunstwerken - Sterkte en stabiliteit puntconstructies", properties.Name); + Assert.AreEqual("STKWp", properties.Code); + Assert.AreEqual(3, properties.LengthEffect); + + GeneralStabilityPointStructuresInput generalInput = failureMechanism.GeneralInput; + Assert.AreEqual(generalInput.GravitationalAcceleration, properties.GravitationalAcceleration); + Assert.AreEqual(generalInput.ModelFactorStorageVolume.Mean, properties.ModelFactorStorageVolume.Mean); + Assert.AreEqual(generalInput.ModelFactorStorageVolume.StandardDeviation, properties.ModelFactorStorageVolume.StandardDeviation); + Assert.AreEqual(generalInput.ModelFactorSubCriticalFlow.Mean, properties.ModelFactorSubCriticalFlow.Mean); + Assert.AreEqual(generalInput.ModelFactorSubCriticalFlow.CoefficientOfVariation, properties.ModelFactorSubCriticalFlow.CoefficientOfVariation); + Assert.AreEqual(generalInput.ModelFactorCollisionLoad.Mean, properties.ModelFactorCollisionLoad.Mean); + Assert.AreEqual(generalInput.ModelFactorCollisionLoad.CoefficientOfVariation, properties.ModelFactorCollisionLoad.CoefficientOfVariation); + Assert.AreEqual(generalInput.ModelFactorLoadEffect.Mean, properties.ModelFactorLoadEffect.Mean); + Assert.AreEqual(generalInput.ModelFactorLoadEffect.StandardDeviation, properties.ModelFactorLoadEffect.StandardDeviation); + Assert.AreEqual(generalInput.ModelFactorInflowVolume, properties.ModelFactorInflowVolume); + Assert.AreEqual(generalInput.ModificationFactorWavesSlowlyVaryingPressureComponent, properties.ModificationFactorWavesSlowlyVaryingPressureComponent); + Assert.AreEqual(generalInput.ModificationFactorDynamicOrImpulsivePressureComponent, properties.ModificationFactorDynamicOrImpulsivePressureComponent); + Assert.AreEqual(generalInput.WaveRatioMaxHN, properties.WaveRatioMaxHN); + Assert.AreEqual(generalInput.WaveRatioMaxHStandardDeviation, properties.WaveRatioMaxHStandardDeviation); + + mockRepository.VerifyAll(); + } + + [Test] + public void SetProperties_IndividualProperties_UpdateDataAndNotifyObservers() + { + // Setup + var observerMock = mockRepository.StrictMock(); + observerMock.Expect(o => o.UpdateObserver()).Repeat.Times(1); + var assessmentSectionMock = mockRepository.StrictMock(); + mockRepository.ReplayAll(); + + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + failureMechanism.Attach(observerMock); + var properties = new StabilityPointStructuresFailureMechanismContextProperties + { + Data = new StabilityPointStructuresFailureMechanismContext(failureMechanism, assessmentSectionMock) + }; + const int newLengthEffect = 10; + + // Call + properties.LengthEffect = newLengthEffect; + + // Assert + Assert.AreEqual(newLengthEffect, failureMechanism.GeneralInput.N); + mockRepository.VerifyAll(); + } + + [Test] + public void PropertyAttributes_ReturnExpectedValues() + { + // Setup + var assessmentSectionMock = mockRepository.StrictMock(); + mockRepository.ReplayAll(); + + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + + // Call + var properties = new StabilityPointStructuresFailureMechanismContextProperties + { + Data = new StabilityPointStructuresFailureMechanismContext(failureMechanism, assessmentSectionMock) + }; + + // Assert + var generalCategory = "Algemeen"; + var lengthEffectCategory = "Lengte-effect parameters"; + var modelSettingsCategory = "Modelinstellingen"; + + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(13, dynamicProperties.Count); + + PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, + generalCategory, + "Naam", + "De naam van het toetsspoor.", + true); + + PropertyDescriptor codeProperty = dynamicProperties[codePropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(codeProperty, + generalCategory, + "Label", + "Het label van het toetsspoor.", + true); + + PropertyDescriptor gravitationalAccelerationProperty = dynamicProperties[gravitationalAccelerationPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(gravitationalAccelerationProperty, + generalCategory, + "Valversnelling [m/s²]", + "Valversnelling.", + true); + + PropertyDescriptor lengthEffectProperty = dynamicProperties[lengthEffectPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(lengthEffectProperty, + lengthEffectCategory, + "N [-]", + "De parameter 'N' die gebruikt wordt om het lengte-effect mee te nemen in een semi-probabilistische beoordeling."); + + PropertyDescriptor modelFactorStorageVolumeProperty = dynamicProperties[modelFactorStorageVolumePropertyIndex]; + Assert.IsInstanceOf(modelFactorStorageVolumeProperty.Converter); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(modelFactorStorageVolumeProperty, + modelSettingsCategory, + "Modelfactor kombergend vermogen [-]", + "Modelfactor kombergend vermogen.", + true); + + PropertyDescriptor modelFactorSubCriticalFlowProperty = dynamicProperties[modelFactorSubCriticalFlowPropertyIndex]; + Assert.IsInstanceOf(modelFactorSubCriticalFlowProperty.Converter); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(modelFactorSubCriticalFlowProperty, + modelSettingsCategory, + "Modelfactor voor onvolkomen stroming [-]", + "Modelfactor voor onvolkomen stroming.", + true); + + PropertyDescriptor modelFactorCollisionLoadProperty = dynamicProperties[modelFactorCollisionLoadPropertyIndex]; + Assert.IsInstanceOf(modelFactorCollisionLoadProperty.Converter); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(modelFactorCollisionLoadProperty, + modelSettingsCategory, + "Modelfactor voor aanvaarbelasting [-]", + "Modelfactor voor aanvaarbelasting.", + true); + + PropertyDescriptor modelFactorLoadEffectProperty = dynamicProperties[modelFactorLoadEffectPropertyIndex]; + Assert.IsInstanceOf(modelFactorLoadEffectProperty.Converter); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(modelFactorLoadEffectProperty, + modelSettingsCategory, + "Modelfactor belastingeffect [-]", + "Modelfactor belastingeffect.", + true); + + PropertyDescriptor modelFactorInflowVolumeProperty = dynamicProperties[modelFactorInflowVolumePropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(modelFactorInflowVolumeProperty, + modelSettingsCategory, + "Modelfactor instromend volume [-]", + "Modelfactor instromend volume.", + true); + + PropertyDescriptor modificationFactorWavesSlowlyVaryingPressureComponentProperty = dynamicProperties[modificationFactorWavesSlowlyVaryingPressureComponentPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(modificationFactorWavesSlowlyVaryingPressureComponentProperty, + modelSettingsCategory, + "Modificatiefactor geometrie van de wand [-]", + "Modificatiefactor voor de geometrie van de wand.", + true); + + PropertyDescriptor modificationFactorDynamicOrImpulsivePressureComponentProperty = dynamicProperties[modificationFactorDynamicOrImpulsivePressureComponentPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(modificationFactorDynamicOrImpulsivePressureComponentProperty, + modelSettingsCategory, + "Modificatiefactor aard van de wand [-]", + "Modificatiefactor voor de aard van de wand.", + true); + + PropertyDescriptor waveRatioMaxHNProperty = dynamicProperties[waveRatioMaxHNPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waveRatioMaxHNProperty, + modelSettingsCategory, + "Rayleigh-N N parameter [-]", + "N parameter van de Rayleigh-N verdeling voor het quotiënt van Hmax en Hs voor N golven.", + true); + + PropertyDescriptor waveRatioMaxHStandardDeviationProperty = dynamicProperties[waveRatioMaxHStandardDeviationPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waveRatioMaxHStandardDeviationProperty, + modelSettingsCategory, + "Rayleigh-N schaal parameter [-]", + "Schaal parameter van de Rayleigh-N verdeling voor het quotiënt van Hmax en Hs voor N golven.", + true); + + mockRepository.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Ringtoets.StabilityPointStructures.Forms.Test.csproj =================================================================== diff -u -r2b2da37541708b8ad95286e731010dd9d27d5070 -r9f61d93bd5ff6bd9ffdf384d633d008ff43187cb --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Ringtoets.StabilityPointStructures.Forms.Test.csproj (.../Ringtoets.StabilityPointStructures.Forms.Test.csproj) (revision 2b2da37541708b8ad95286e731010dd9d27d5070) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Ringtoets.StabilityPointStructures.Forms.Test.csproj (.../Ringtoets.StabilityPointStructures.Forms.Test.csproj) (revision 9f61d93bd5ff6bd9ffdf384d633d008ff43187cb) @@ -69,6 +69,7 @@ +