Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -r11faaf2149d31eb83bcb32b8be0e989b477d3c83 -rab9e6a1f47225304b418f5fce8a3c321e7439886 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 11faaf2149d31eb83bcb32b8be0e989b477d3c83) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision ab9e6a1f47225304b418f5fce8a3c321e7439886) @@ -385,11 +385,15 @@ { CreateInstance = context => new ReferenceLineProperties(context.WrappedData) }; - yield return new PropertyInfo + yield return new PropertyInfo { CreateInstance = context => new FailureMechanismAssemblyCategoriesProperties(context.GetFailureMechanismCategoriesFunc(), context.GetFailureMechanismSectionAssemblyCategoriesFunc()) }; + yield return new PropertyInfo + { + CreateInstance = context => new FailureMechanismSectionAssemblyCategoriesProperties(context.GetFailureMechanismSectionAssemblyCategoriesFunc()) + }; yield return new PropertyInfo { CreateInstance = context => Fisheye: Tag ab9e6a1f47225304b418f5fce8a3c321e7439886 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/FailureMechanismAssemblyCategoriesContextBasePropertyInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/FailureMechanismAssemblyCategoriesContextPropertyInfoTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/FailureMechanismAssemblyCategoriesContextPropertyInfoTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/FailureMechanismAssemblyCategoriesContextPropertyInfoTest.cs (revision ab9e6a1f47225304b418f5fce8a3c321e7439886) @@ -0,0 +1,102 @@ +// Copyright (C) Stichting Deltares 2017. 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.Collections.Generic; +using System.Linq; +using Core.Common.Gui.Plugin; +using Core.Common.Gui.PropertyBag; +using Core.Common.TestUtil; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.AssemblyTool.Data; +using Ringtoets.AssemblyTool.KernelWrapper.Calculators; +using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators; +using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators.Categories; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Common.Forms.PresentationObjects; +using Ringtoets.Integration.Forms.PropertyClasses; +using Ringtoets.Integration.Forms.TestUtil; + +namespace Ringtoets.Integration.Plugin.Test.PropertyInfos +{ + [TestFixture] + public class FailureMechanismAssemblyCategoriesContextPropertyInfoTest + { + private RingtoetsPlugin plugin; + private PropertyInfo info; + + [SetUp] + public void SetUp() + { + plugin = new RingtoetsPlugin(); + info = plugin.GetPropertyInfos().First(tni => tni.PropertyObjectType == typeof(FailureMechanismAssemblyCategoriesProperties)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(FailureMechanismAssemblyCategoriesContext), info.DataType); + } + + [Test] + public void CreateInstance_ValidArguments_ReturnProperties() + { + // Setup + var mocks = new MockRepository(); + var failureMechanism = mocks.Stub(); + mocks.ReplayAll(); + + var assessmentSection = new AssessmentSectionStub(); + + var context = new FailureMechanismAssemblyCategoriesContext(failureMechanism, assessmentSection, + () => 0); + + using (new AssemblyToolCalculatorFactoryConfig()) + { + var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; + AssemblyCategoriesCalculatorStub calculator = calculatorFactory.LastCreatedAssemblyCategoriesCalculator; + + // Call + IObjectProperties objectProperties = info.CreateInstance(context); + + // Assert + Assert.IsInstanceOf(objectProperties); + + var properties = (FailureMechanismAssemblyCategoriesProperties) objectProperties; + AssemblyCategoryPropertiesTestHelper.AssertFailureMechanismAssemblyCategoryProperties( + calculator.FailureMechanismCategoriesOutput, + context.GetFailureMechanismSectionAssemblyCategoriesFunc(), + properties); + } + + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/MacroStabilityOutwardsAssemblyCategoriesContextPropertyInfoTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/MacroStabilityOutwardsAssemblyCategoriesContextPropertyInfoTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/MacroStabilityOutwardsAssemblyCategoriesContextPropertyInfoTest.cs (revision ab9e6a1f47225304b418f5fce8a3c321e7439886) @@ -0,0 +1,85 @@ +// Copyright (C) Stichting Deltares 2017. 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 Core.Common.Gui.PropertyBag; +using NUnit.Framework; +using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Integration.Data.StandAlone; +using Ringtoets.Integration.Forms.PresentationObjects; +using Ringtoets.Integration.Forms.PropertyClasses; +using Ringtoets.Integration.Forms.TestUtil; + +namespace Ringtoets.Integration.Plugin.Test.PropertyInfos +{ + [TestFixture] + public class MacroStabilityOutwardsAssemblyCategoriesContextPropertyInfoTest + { + private RingtoetsPlugin plugin; + private PropertyInfo info; + + [SetUp] + public void SetUp() + { + plugin = new RingtoetsPlugin(); + info = plugin.GetPropertyInfos().First(tni => tni.PropertyObjectType == typeof(FailureMechanismSectionAssemblyCategoriesProperties)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(MacroStabilityOutwardsAssemblyCategoriesContext), info.DataType); + } + + [Test] + public void CreateInstance_ValidArguments_ReturnProperties() + { + // Setup + var assessmentSection = new AssessmentSectionStub(); + var failureMechanism = new MacroStabilityOutwardsFailureMechanism(); + var context = new MacroStabilityOutwardsAssemblyCategoriesContext(failureMechanism, assessmentSection, + () => 0); + + using (new AssemblyToolCalculatorFactoryConfig()) + { + // Call + IObjectProperties objectProperties = info.CreateInstance(context); + + // Assert + Assert.IsInstanceOf(objectProperties); + + var properties = (FailureMechanismSectionAssemblyCategoriesProperties) objectProperties; + AssemblyCategoryPropertiesTestHelper.AssertFailureMechanismSectionAssemblyCategoryProperties( + context.GetFailureMechanismSectionAssemblyCategoriesFunc(), + properties); + } + } + } +} \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj =================================================================== diff -u -r2da5195c838a61f9b98a178d4add2e93d7c7bfb7 -rab9e6a1f47225304b418f5fce8a3c321e7439886 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision 2da5195c838a61f9b98a178d4add2e93d7c7bfb7) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision ab9e6a1f47225304b418f5fce8a3c321e7439886) @@ -73,9 +73,10 @@ + - + Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs =================================================================== diff -u -r2da5195c838a61f9b98a178d4add2e93d7c7bfb7 -rab9e6a1f47225304b418f5fce8a3c321e7439886 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 2da5195c838a61f9b98a178d4add2e93d7c7bfb7) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision ab9e6a1f47225304b418f5fce8a3c321e7439886) @@ -223,7 +223,7 @@ PropertyInfo[] propertyInfos = plugin.GetPropertyInfos().ToArray(); // Assert - Assert.AreEqual(26, propertyInfos.Length); + Assert.AreEqual(27, propertyInfos.Length); PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, @@ -342,11 +342,16 @@ PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, - typeof(FailureMechanismAssemblyCategoriesContextBase), + typeof(FailureMechanismAssemblyCategoriesContext), typeof(FailureMechanismAssemblyCategoriesProperties)); PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, + typeof(MacroStabilityOutwardsAssemblyCategoriesContext), + typeof(FailureMechanismSectionAssemblyCategoriesProperties)); + + PluginTestHelper.AssertPropertyInfoDefined( + propertyInfos, typeof(DesignWaterLevelCalculationsGroupContext), typeof(DesignWaterLevelCalculationsGroupProperties));