Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/GrassCoverErosionOutwardsPluginTest.cs =================================================================== diff -u -r88a71efb5e821ce8738d822e5c92580cfc7b172c -r6da94dc5f56cf8edbf991440dd97f5b28856e658 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/GrassCoverErosionOutwardsPluginTest.cs (.../GrassCoverErosionOutwardsPluginTest.cs) (revision 88a71efb5e821ce8738d822e5c92580cfc7b172c) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/GrassCoverErosionOutwardsPluginTest.cs (.../GrassCoverErosionOutwardsPluginTest.cs) (revision 6da94dc5f56cf8edbf991440dd97f5b28856e658) @@ -32,7 +32,6 @@ using Ringtoets.GrassCoverErosionOutwards.Forms.PresentationObjects; using Ringtoets.GrassCoverErosionOutwards.Forms.PropertyClasses; using Ringtoets.GrassCoverErosionOutwards.Forms.Views; -using Ringtoets.Revetment.Forms.PresentationObjects; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.GrassCoverErosionOutwards.Plugin.Test Fisheye: Tag 6da94dc5f56cf8edbf991440dd97f5b28856e658 refers to a dead (removed) revision in file `Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailureMechanismContextProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailureMechanismProperties.cs =================================================================== diff -u --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailureMechanismProperties.cs (revision 0) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailureMechanismProperties.cs (revision 6da94dc5f56cf8edbf991440dd97f5b28856e658) @@ -0,0 +1,102 @@ +// 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.Gui.Attributes; +using Core.Common.Gui.PropertyBag; +using Core.Common.Utils.Attributes; +using Ringtoets.Revetment.Forms.PropertyClasses; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.StabilityStoneCover.Forms.Properties; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.StabilityStoneCover.Forms.PropertyClasses +{ + /// + /// ViewModel of for properties panel. + /// + public class StabilityStoneCoverFailureMechanismProperties : ObjectProperties + { + #region General + + [PropertyOrder(1)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_General")] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), "FailureMechanism_Name_DisplayName")] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), "FailureMechanism_Name_Description")] + public string Name + { + get + { + return data.Name; + } + } + + [PropertyOrder(2)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_General")] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), "FailureMechanism_Code_DisplayName")] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), "FailureMechanism_Code_Description")] + public string Code + { + get + { + return data.Code; + } + } + + #endregion + + #region Model settings + + [PropertyOrder(3)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_ModelSettings")] + [ResourcesDisplayName(typeof(Resources), "StabilityStoneCoverWaveConditions_Blocks_DisplayName")] + [ResourcesDescription(typeof(Resources), "StabilityStoneCoverWaveConditionsFailureMechanism_Blocks_Description")] + public GeneralWaveConditionsInputProperties Blocks + { + get + { + return new GeneralWaveConditionsInputProperties + { + Data = data.GeneralInput.GeneralBlocksWaveConditionsInput + }; + } + } + + [PropertyOrder(4)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_ModelSettings")] + [ResourcesDisplayName(typeof(Resources), "StabilityStoneCoverWaveConditions_Columns_DisplayName")] + [ResourcesDescription(typeof(Resources), "StabilityStoneCoverWaveConditionsFailureMechanism_Columns_Description")] + public GeneralWaveConditionsInputProperties Columns + { + get + { + return new GeneralWaveConditionsInputProperties + { + Data = data.GeneralInput.GeneralColumnsWaveConditionsInput + }; + } + } + + #endregion + } +} \ No newline at end of file Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Ringtoets.StabilityStoneCover.Forms.csproj =================================================================== diff -u -rf3e0a05168328097121cfa8f9c4ff32d775879ff -r6da94dc5f56cf8edbf991440dd97f5b28856e658 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Ringtoets.StabilityStoneCover.Forms.csproj (.../Ringtoets.StabilityStoneCover.Forms.csproj) (revision f3e0a05168328097121cfa8f9c4ff32d775879ff) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Ringtoets.StabilityStoneCover.Forms.csproj (.../Ringtoets.StabilityStoneCover.Forms.csproj) (revision 6da94dc5f56cf8edbf991440dd97f5b28856e658) @@ -52,7 +52,7 @@ True Resources.resx - + Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs =================================================================== diff -u -r254f70f60d07ff9d8778b270f80a4910cb71c053 -r6da94dc5f56cf8edbf991440dd97f5b28856e658 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs (.../StabilityStoneCoverPlugin.cs) (revision 254f70f60d07ff9d8778b270f80a4910cb71c053) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs (.../StabilityStoneCoverPlugin.cs) (revision 6da94dc5f56cf8edbf991440dd97f5b28856e658) @@ -62,7 +62,10 @@ { public override IEnumerable GetPropertyInfos() { - yield return new PropertyInfo(); + yield return new PropertyInfo + { + GetObjectPropertiesData = context => context.WrappedData + }; yield return new PropertyInfo(); } Fisheye: Tag 6da94dc5f56cf8edbf991440dd97f5b28856e658 refers to a dead (removed) revision in file `Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailureMechanismContextPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailureMechanismPropertiesTest.cs =================================================================== diff -u --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailureMechanismPropertiesTest.cs (revision 0) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailureMechanismPropertiesTest.cs (revision 6da94dc5f56cf8edbf991440dd97f5b28856e658) @@ -0,0 +1,108 @@ +// 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; +using System.ComponentModel; +using Core.Common.Gui.PropertyBag; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.StabilityStoneCover.Forms.PresentationObjects; +using Ringtoets.StabilityStoneCover.Forms.PropertyClasses; + +namespace Ringtoets.StabilityStoneCover.Forms.Test.PropertyClasses +{ + [TestFixture] + public class StabilityStoneCoverFailureMechanismPropertiesTest + { + [Test] + public void Constructor_ExpectedValues() + { + // Call + var properties = new StabilityStoneCoverFailureMechanismProperties(); + + // Assert + Assert.IsInstanceOf>(properties); + } + + [Test] + public void Data_SetNewStabilityStoneCoverFailureMechanismContext_ReturnCorrectPropertyValues() + { + // Setup + var failureMechanism = new StabilityStoneCoverFailureMechanism(); + var properties = new StabilityStoneCoverFailureMechanismProperties(); + + // Call + properties.Data = failureMechanism; + + // Assert + Assert.AreEqual(failureMechanism.Name, properties.Name); + Assert.AreEqual(failureMechanism.Code, properties.Code); + Assert.AreSame(failureMechanism.GeneralInput.GeneralBlocksWaveConditionsInput, properties.Blocks.Data); + Assert.AreSame(failureMechanism.GeneralInput.GeneralColumnsWaveConditionsInput, properties.Columns.Data); + } + + [Test] + public void PropertyAttributes_ReturnExpectedValues() + { + // Call + var properties = new StabilityStoneCoverFailureMechanismProperties + { + Data = new StabilityStoneCoverFailureMechanism() + }; + + // Assert + var dynamicPropertyBag = new DynamicPropertyBag(properties); + PropertyDescriptorCollection dynamicProperties = dynamicPropertyBag.GetProperties(new Attribute[] + { + BrowsableAttribute.Yes + }); + Assert.AreEqual(4, dynamicProperties.Count); + + 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); + + 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); + + PropertyDescriptor blocksProperty = dynamicProperties[2]; + Assert.IsTrue(blocksProperty.IsReadOnly); + 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); + 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); + } + } +} \ No newline at end of file Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Ringtoets.StabilityStoneCover.Forms.Test.csproj =================================================================== diff -u -r254f70f60d07ff9d8778b270f80a4910cb71c053 -r6da94dc5f56cf8edbf991440dd97f5b28856e658 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Ringtoets.StabilityStoneCover.Forms.Test.csproj (.../Ringtoets.StabilityStoneCover.Forms.Test.csproj) (revision 254f70f60d07ff9d8778b270f80a4910cb71c053) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Ringtoets.StabilityStoneCover.Forms.Test.csproj (.../Ringtoets.StabilityStoneCover.Forms.Test.csproj) (revision 6da94dc5f56cf8edbf991440dd97f5b28856e658) @@ -74,7 +74,7 @@ - + Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/PropertyInfos/StabilityStoneCoverFailureMechanismContextPropertyInfoTest.cs =================================================================== diff -u --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/PropertyInfos/StabilityStoneCoverFailureMechanismContextPropertyInfoTest.cs (revision 0) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/PropertyInfos/StabilityStoneCoverFailureMechanismContextPropertyInfoTest.cs (revision 6da94dc5f56cf8edbf991440dd97f5b28856e658) @@ -0,0 +1,82 @@ +// 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.Linq; +using Core.Common.Gui.Plugin; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.StabilityStoneCover.Forms.PresentationObjects; +using Ringtoets.StabilityStoneCover.Forms.PropertyClasses; + +namespace Ringtoets.StabilityStoneCover.Plugin.Test.PropertyInfos +{ + [TestFixture] + public class StabilityStoneCoverFailureMechanismContextPropertyInfoTest + { + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Setup + using (var plugin = new StabilityStoneCoverPlugin()) + { + // Call + PropertyInfo info = GetInfo(plugin); + + // Assert + Assert.IsNull(info.AdditionalDataCheck); + Assert.IsNull(info.AfterCreate); + Assert.AreEqual(typeof(StabilityStoneCoverFailureMechanismContext), info.DataType); + Assert.AreEqual(typeof(StabilityStoneCoverFailureMechanismProperties), info.PropertyObjectType); + } + } + + [Test] + public void GetObjectPropertiesData_Always_ReturnsHydraulicBoundaryDatabase() + { + // Setup + var mocks = new MockRepository(); + var assessmentSectionMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var failureMechanism = new StabilityStoneCoverFailureMechanism(); + var context = new StabilityStoneCoverFailureMechanismContext(failureMechanism, assessmentSectionMock); + + using (var plugin = new StabilityStoneCoverPlugin()) + { + PropertyInfo info = GetInfo(plugin); + + // Call + var objectPropertiesData = info.GetObjectPropertiesData(context); + + // Assert + Assert.AreSame(failureMechanism, objectPropertiesData); + } + mocks.VerifyAll(); + } + + private static PropertyInfo GetInfo(StabilityStoneCoverPlugin plugin) + { + return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(StabilityStoneCoverFailureMechanismContext)); + } + } +} \ No newline at end of file Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/Ringtoets.StabilityStoneCover.Plugin.Test.csproj =================================================================== diff -u -rbfe0c885c674d20d6ed6fbfb95e9cdc484b4788c -r6da94dc5f56cf8edbf991440dd97f5b28856e658 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/Ringtoets.StabilityStoneCover.Plugin.Test.csproj (.../Ringtoets.StabilityStoneCover.Plugin.Test.csproj) (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/Ringtoets.StabilityStoneCover.Plugin.Test.csproj (.../Ringtoets.StabilityStoneCover.Plugin.Test.csproj) (revision 6da94dc5f56cf8edbf991440dd97f5b28856e658) @@ -55,6 +55,7 @@ Properties\GlobalAssembly.cs + Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/StabilityStoneCoverPluginTest.cs =================================================================== diff -u -r254f70f60d07ff9d8778b270f80a4910cb71c053 -r6da94dc5f56cf8edbf991440dd97f5b28856e658 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/StabilityStoneCoverPluginTest.cs (.../StabilityStoneCoverPluginTest.cs) (revision 254f70f60d07ff9d8778b270f80a4910cb71c053) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/StabilityStoneCoverPluginTest.cs (.../StabilityStoneCoverPluginTest.cs) (revision 6da94dc5f56cf8edbf991440dd97f5b28856e658) @@ -27,8 +27,6 @@ using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Forms.PresentationObjects; -using Ringtoets.Revetment.Forms.PresentationObjects; -using Ringtoets.Revetment.Forms.PropertyClasses; using Ringtoets.StabilityStoneCover.Data; using Ringtoets.StabilityStoneCover.Forms.PresentationObjects; using Ringtoets.StabilityStoneCover.Forms.PropertyClasses; @@ -54,7 +52,7 @@ PluginTestHelper.AssertPropertyInfoDefined< StabilityStoneCoverFailureMechanismContext, - StabilityStoneCoverFailureMechanismContextProperties>(propertyInfos); + StabilityStoneCoverFailureMechanismProperties>(propertyInfos); PluginTestHelper.AssertPropertyInfoDefined< StabilityStoneCoverWaveConditionsOutput, StabilityStoneCoverWaveConditionsOutputProperties>(propertyInfos); Fisheye: Tag 6da94dc5f56cf8edbf991440dd97f5b28856e658 refers to a dead (removed) revision in file `Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/PropertyClasses/WaveImpactAsphaltCoverFailureMechanismContextProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/PropertyClasses/WaveImpactAsphaltCoverFailureMechanismProperties.cs =================================================================== diff -u --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/PropertyClasses/WaveImpactAsphaltCoverFailureMechanismProperties.cs (revision 0) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/PropertyClasses/WaveImpactAsphaltCoverFailureMechanismProperties.cs (revision 6da94dc5f56cf8edbf991440dd97f5b28856e658) @@ -0,0 +1,105 @@ +// 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 Core.Common.Base.Data; +using Core.Common.Gui.Attributes; +using Core.Common.Gui.PropertyBag; +using Core.Common.Utils.Attributes; +using Ringtoets.WaveImpactAsphaltCover.Data; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; +using RingtoetsRevetmentFormsResources = Ringtoets.Revetment.Forms.Properties.Resources; + +namespace Ringtoets.WaveImpactAsphaltCover.Forms.PropertyClasses +{ + /// + /// ViewModel of for properties panel. + /// + public class WaveImpactAsphaltCoverFailureMechanismProperties : ObjectProperties + { + #region General + + [PropertyOrder(1)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_General")] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), "FailureMechanism_Name_DisplayName")] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), "FailureMechanism_Name_Description")] + public string Name + { + get + { + return data.Name; + } + } + + [PropertyOrder(2)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_General")] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), "FailureMechanism_Code_DisplayName")] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), "FailureMechanism_Code_Description")] + public string Code + { + get + { + return data.Code; + } + } + + #endregion + + #region Model settings + + [PropertyOrder(3)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_ModelSettings")] + [ResourcesDisplayName(typeof(RingtoetsRevetmentFormsResources), "GeneralWaveConditionsInput_A_DisplayName")] + [ResourcesDescription(typeof(RingtoetsRevetmentFormsResources), "GeneralWaveConditionsInput_A_Description")] + public RoundedDouble A + { + get + { + return data.GeneralInput.A; + } + } + + [PropertyOrder(4)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_ModelSettings")] + [ResourcesDisplayName(typeof(RingtoetsRevetmentFormsResources), "GeneralWaveConditionsInput_B_DisplayName")] + [ResourcesDescription(typeof(RingtoetsRevetmentFormsResources), "GeneralWaveConditionsInput_B_Description")] + public RoundedDouble B + { + get + { + return data.GeneralInput.B; + } + } + + [PropertyOrder(5)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_ModelSettings")] + [ResourcesDisplayName(typeof(RingtoetsRevetmentFormsResources), "GeneralWaveConditionsInput_C_DisplayName")] + [ResourcesDescription(typeof(RingtoetsRevetmentFormsResources), "GeneralWaveConditionsInput_C_Description")] + public RoundedDouble C + { + get + { + return data.GeneralInput.C; + } + } + + #endregion + } +} \ No newline at end of file Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/Ringtoets.WaveImpactAsphaltCover.Forms.csproj =================================================================== diff -u -re42e4a7194308cf8d5ac461cc219cb21f699b96e -r6da94dc5f56cf8edbf991440dd97f5b28856e658 --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/Ringtoets.WaveImpactAsphaltCover.Forms.csproj (.../Ringtoets.WaveImpactAsphaltCover.Forms.csproj) (revision e42e4a7194308cf8d5ac461cc219cb21f699b96e) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/Ringtoets.WaveImpactAsphaltCover.Forms.csproj (.../Ringtoets.WaveImpactAsphaltCover.Forms.csproj) (revision 6da94dc5f56cf8edbf991440dd97f5b28856e658) @@ -48,7 +48,7 @@ - + True True Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs =================================================================== diff -u -r254f70f60d07ff9d8778b270f80a4910cb71c053 -r6da94dc5f56cf8edbf991440dd97f5b28856e658 --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs (.../WaveImpactAsphaltCoverPlugin.cs) (revision 254f70f60d07ff9d8778b270f80a4910cb71c053) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs (.../WaveImpactAsphaltCoverPlugin.cs) (revision 6da94dc5f56cf8edbf991440dd97f5b28856e658) @@ -60,7 +60,10 @@ { public override IEnumerable GetPropertyInfos() { - yield return new PropertyInfo(); + yield return new PropertyInfo + { + GetObjectPropertiesData = context => context.WrappedData + }; } public override IEnumerable GetViewInfos() Fisheye: Tag 6da94dc5f56cf8edbf991440dd97f5b28856e658 refers to a dead (removed) revision in file `Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/PropertyClasses/WaveImpactAsphaltCoverFailureMechanismContextPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/PropertyClasses/WaveImpactAsphaltCoverFailureMechanismPropertiesTest.cs =================================================================== diff -u --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/PropertyClasses/WaveImpactAsphaltCoverFailureMechanismPropertiesTest.cs (revision 0) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/PropertyClasses/WaveImpactAsphaltCoverFailureMechanismPropertiesTest.cs (revision 6da94dc5f56cf8edbf991440dd97f5b28856e658) @@ -0,0 +1,110 @@ +// 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; +using System.ComponentModel; +using Core.Common.Gui.PropertyBag; +using NUnit.Framework; +using Ringtoets.WaveImpactAsphaltCover.Data; +using Ringtoets.WaveImpactAsphaltCover.Forms.PropertyClasses; + +namespace Ringtoets.WaveImpactAsphaltCover.Forms.Test.PropertyClasses +{ + [TestFixture] + public class WaveImpactAsphaltCoverFailureMechanismPropertiesTest + { + [Test] + public void Constructor_ExpectedValues() + { + // Call + var properties = new WaveImpactAsphaltCoverFailureMechanismProperties(); + + // Assert + Assert.IsInstanceOf>(properties); + } + + [Test] + public void Data_SetNewWaveImpactAsphaltCoverFailureMechanismContext_ReturnCorrectPropertyValues() + { + // Setup + var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); + var properties = new WaveImpactAsphaltCoverFailureMechanismProperties(); + + // Call + properties.Data = failureMechanism; + + // Assert + Assert.AreEqual(failureMechanism.Name, properties.Name); + Assert.AreEqual(failureMechanism.Code, properties.Code); + } + + [Test] + public void PropertyAttributes_ReturnExpectedValues() + { + // Call + var properties = new WaveImpactAsphaltCoverFailureMechanismProperties + { + Data = new WaveImpactAsphaltCoverFailureMechanism() + }; + + // Assert + var dynamicPropertyBag = new DynamicPropertyBag(properties); + PropertyDescriptorCollection dynamicProperties = dynamicPropertyBag.GetProperties(new Attribute[] + { + BrowsableAttribute.Yes + }); + Assert.AreEqual(5, dynamicProperties.Count); + + 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); + + 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); + + PropertyDescriptor aProperty = dynamicProperties[2]; + Assert.IsNotNull(aProperty); + Assert.IsTrue(aProperty.IsReadOnly); + Assert.AreEqual("Modelinstellingen", aProperty.Category); + Assert.AreEqual("a", aProperty.DisplayName); + Assert.AreEqual("De waarde van de parameter 'a' in de berekening voor golf condities.", aProperty.Description); + + PropertyDescriptor bProperty = dynamicProperties[3]; + Assert.IsNotNull(bProperty); + Assert.IsTrue(bProperty.IsReadOnly); + Assert.AreEqual("Modelinstellingen", bProperty.Category); + Assert.AreEqual("b", bProperty.DisplayName); + Assert.AreEqual("De waarde van de parameter 'b' in de berekening voor golf condities.", bProperty.Description); + + PropertyDescriptor cProperty = dynamicProperties[4]; + Assert.IsNotNull(cProperty); + Assert.IsTrue(cProperty.IsReadOnly); + Assert.AreEqual("Modelinstellingen", cProperty.Category); + Assert.AreEqual("c", cProperty.DisplayName); + Assert.AreEqual("De waarde van de parameter 'c' in de berekening voor golf condities.", cProperty.Description); + } + } +} \ No newline at end of file Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Ringtoets.WaveImpactAsphaltCover.Forms.Test.csproj =================================================================== diff -u -r68579356ae04086051adec7a13109406a2e0614d -r6da94dc5f56cf8edbf991440dd97f5b28856e658 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Ringtoets.WaveImpactAsphaltCover.Forms.Test.csproj (.../Ringtoets.WaveImpactAsphaltCover.Forms.Test.csproj) (revision 68579356ae04086051adec7a13109406a2e0614d) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Ringtoets.WaveImpactAsphaltCover.Forms.Test.csproj (.../Ringtoets.WaveImpactAsphaltCover.Forms.Test.csproj) (revision 6da94dc5f56cf8edbf991440dd97f5b28856e658) @@ -65,7 +65,7 @@ - + Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/PropertyInfos/WaveImpactAsphaltCoverFailureMechanismContextPropertyInfoTest.cs =================================================================== diff -u --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/PropertyInfos/WaveImpactAsphaltCoverFailureMechanismContextPropertyInfoTest.cs (revision 0) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/PropertyInfos/WaveImpactAsphaltCoverFailureMechanismContextPropertyInfoTest.cs (revision 6da94dc5f56cf8edbf991440dd97f5b28856e658) @@ -0,0 +1,82 @@ +// 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.Linq; +using Core.Common.Gui.Plugin; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.WaveImpactAsphaltCover.Data; +using Ringtoets.WaveImpactAsphaltCover.Forms.PresentationObjects; +using Ringtoets.WaveImpactAsphaltCover.Forms.PropertyClasses; + +namespace Ringtoets.WaveImpactAsphaltCover.Plugin.Test.PropertyInfos +{ + [TestFixture] + public class WaveImpactAsphaltCoverFailureMechanismContextPropertyInfoTest + { + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Setup + using (var plugin = new WaveImpactAsphaltCoverPlugin()) + { + // Call + PropertyInfo info = GetInfo(plugin); + + // Assert + Assert.IsNull(info.AdditionalDataCheck); + Assert.IsNull(info.AfterCreate); + Assert.AreEqual(typeof(WaveImpactAsphaltCoverFailureMechanismContext), info.DataType); + Assert.AreEqual(typeof(WaveImpactAsphaltCoverFailureMechanismProperties), info.PropertyObjectType); + } + } + + [Test] + public void GetObjectPropertiesData_Always_ReturnsHydraulicBoundaryDatabase() + { + // Setup + var mocks = new MockRepository(); + var assessmentSectionMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); + var context = new WaveImpactAsphaltCoverFailureMechanismContext(failureMechanism, assessmentSectionMock); + + using (var plugin = new WaveImpactAsphaltCoverPlugin()) + { + PropertyInfo info = GetInfo(plugin); + + // Call + var objectPropertiesData = info.GetObjectPropertiesData(context); + + // Assert + Assert.AreSame(failureMechanism, objectPropertiesData); + } + mocks.VerifyAll(); + } + + private static PropertyInfo GetInfo(WaveImpactAsphaltCoverPlugin plugin) + { + return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(WaveImpactAsphaltCoverFailureMechanismContext)); + } + } +} \ No newline at end of file Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test.csproj =================================================================== diff -u -r68579356ae04086051adec7a13109406a2e0614d -r6da94dc5f56cf8edbf991440dd97f5b28856e658 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test.csproj (.../Ringtoets.WaveImpactAsphaltCover.Plugin.Test.csproj) (revision 68579356ae04086051adec7a13109406a2e0614d) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test.csproj (.../Ringtoets.WaveImpactAsphaltCover.Plugin.Test.csproj) (revision 6da94dc5f56cf8edbf991440dd97f5b28856e658) @@ -54,6 +54,7 @@ Properties\GlobalAssembly.cs + Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/WaveImpactAsphaltCoverPluginTest.cs =================================================================== diff -u -r254f70f60d07ff9d8778b270f80a4910cb71c053 -r6da94dc5f56cf8edbf991440dd97f5b28856e658 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/WaveImpactAsphaltCoverPluginTest.cs (.../WaveImpactAsphaltCoverPluginTest.cs) (revision 254f70f60d07ff9d8778b270f80a4910cb71c053) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/WaveImpactAsphaltCoverPluginTest.cs (.../WaveImpactAsphaltCoverPluginTest.cs) (revision 6da94dc5f56cf8edbf991440dd97f5b28856e658) @@ -27,7 +27,6 @@ using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Forms.PresentationObjects; -using Ringtoets.Revetment.Forms.PresentationObjects; using Ringtoets.WaveImpactAsphaltCover.Data; using Ringtoets.WaveImpactAsphaltCover.Forms.PresentationObjects; using Ringtoets.WaveImpactAsphaltCover.Forms.PropertyClasses; @@ -63,9 +62,8 @@ Assert.AreEqual(1, propertyInfos.Length); PropertyInfo failureMechanismContextProperties = PluginTestHelper.AssertPropertyInfoDefined - (propertyInfos); + (propertyInfos); Assert.IsNull(failureMechanismContextProperties.AdditionalDataCheck); - Assert.IsNull(failureMechanismContextProperties.GetObjectPropertiesData); Assert.IsNull(failureMechanismContextProperties.AfterCreate); } }