Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -r66ca75cc41304270ae2491118a74c2d97fcc0060 -r0a4e2fb59de0845c3e978d997fda2fc9fa64cb51 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 66ca75cc41304270ae2491118a74c2d97fcc0060) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 0a4e2fb59de0845c3e978d997fda2fc9fa64cb51) @@ -418,6 +418,10 @@ return new WaveHeightCalculationsGroupProperties(context.WrappedData, calculationsPerCategoryBoundary); } }; + yield return new PropertyInfo + { + CreateInstance = context => new AssemblyResultCategoriesProperties(context.GetCategoriesFunc(), context.WrappedData) + }; } /// Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/AssemblyResultCategoriesContextPropertyInfoTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/AssemblyResultCategoriesContextPropertyInfoTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/AssemblyResultCategoriesContextPropertyInfoTest.cs (revision 0a4e2fb59de0845c3e978d997fda2fc9fa64cb51) @@ -0,0 +1,90 @@ +// 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.Calculators; +using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators; +using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators.Categories; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Integration.Data; +using Ringtoets.Integration.Forms.PresentationObjects; +using Ringtoets.Integration.Forms.PropertyClasses; +using Ringtoets.Integration.Forms.TestUtil; + +namespace Ringtoets.Integration.Plugin.Test.PropertyInfos +{ + [TestFixture] + public class AssemblyResultCategoriesContextPropertyInfoTest + { + private RingtoetsPlugin plugin; + private PropertyInfo info; + + [SetUp] + public void SetUp() + { + plugin = new RingtoetsPlugin(); + info = plugin.GetPropertyInfos().First(tni => tni.PropertyObjectType == typeof(AssemblyResultCategoriesProperties)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(AssemblyResultCategoriesContext), info.DataType); + } + + [Test] + public void CreateInstance_ValidArguments_ReturnProperties() + { + // Setup + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + + var context = new AssemblyResultCategoriesContext(assessmentSection); + + using (new AssemblyToolCalculatorFactoryConfig()) + { + var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; + AssemblyCategoriesCalculatorStub calculator = calculatorFactory.LastCreatedAssemblyCategoriesCalculator; + + // Call + IObjectProperties objectProperties = info.CreateInstance(context); + + // Assert + Assert.IsInstanceOf(objectProperties); + + var properties = (AssemblyResultCategoriesProperties) objectProperties; + Assert.AreSame(context.GetCategoriesFunc(), properties.Data); + AssemblyCategoryPropertiesTestHelper.AssertFailureMechanismAssemblyCategoryProperties( + calculator.FailureMechanismCategoriesOutput, + properties); + } + } + } +} \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj =================================================================== diff -u -r66ca75cc41304270ae2491118a74c2d97fcc0060 -r0a4e2fb59de0845c3e978d997fda2fc9fa64cb51 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision 66ca75cc41304270ae2491118a74c2d97fcc0060) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision 0a4e2fb59de0845c3e978d997fda2fc9fa64cb51) @@ -72,6 +72,7 @@ + Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs =================================================================== diff -u -r66ca75cc41304270ae2491118a74c2d97fcc0060 -r0a4e2fb59de0845c3e978d997fda2fc9fa64cb51 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 66ca75cc41304270ae2491118a74c2d97fcc0060) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 0a4e2fb59de0845c3e978d997fda2fc9fa64cb51) @@ -223,7 +223,7 @@ PropertyInfo[] propertyInfos = plugin.GetPropertyInfos().ToArray(); // Assert - Assert.AreEqual(27, propertyInfos.Length); + Assert.AreEqual(28, propertyInfos.Length); PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, @@ -359,6 +359,11 @@ propertyInfos, typeof(WaveHeightCalculationsGroupContext), typeof(WaveHeightCalculationsGroupProperties)); + + PluginTestHelper.AssertPropertyInfoDefined( + propertyInfos, + typeof(AssemblyResultCategoriesContext), + typeof(AssemblyResultCategoriesProperties)); } }