Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Plugin/ClosingStructuresPlugin.cs =================================================================== diff -u -racb45246d666b955705c808a110fa23f4e650a5c -r327fdd939671af52327e89c26a177fa666ba97a9 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Plugin/ClosingStructuresPlugin.cs (.../ClosingStructuresPlugin.cs) (revision acb45246d666b955705c808a110fa23f4e650a5c) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Plugin/ClosingStructuresPlugin.cs (.../ClosingStructuresPlugin.cs) (revision 327fdd939671af52327e89c26a177fa666ba97a9) @@ -85,6 +85,12 @@ context, new ObservablePropertyChangeHandler(context.Calculation, context.WrappedData)) }; + yield return new PropertyInfo + { + CreateInstance = context => new ClosingStructuresOutputProperties(context.WrappedData.Output, + context.FailureMechanism, + context.AssessmentSection) + }; } public override IEnumerable GetViewInfos() Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ClosingStructuresPluginTest.cs =================================================================== diff -u -r92acb4483676af5adad598c2ea8ca46f9b8379c1 -r327fdd939671af52327e89c26a177fa666ba97a9 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ClosingStructuresPluginTest.cs (.../ClosingStructuresPluginTest.cs) (revision 92acb4483676af5adad598c2ea8ca46f9b8379c1) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ClosingStructuresPluginTest.cs (.../ClosingStructuresPluginTest.cs) (revision 327fdd939671af52327e89c26a177fa666ba97a9) @@ -59,7 +59,7 @@ PropertyInfo[] propertyInfos = plugin.GetPropertyInfos().ToArray(); // Assert - Assert.AreEqual(4, propertyInfos.Length); + Assert.AreEqual(5, propertyInfos.Length); PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, @@ -80,6 +80,11 @@ propertyInfos, typeof(ClosingStructuresInputContext), typeof(ClosingStructuresInputContextProperties)); + + PluginTestHelper.AssertPropertyInfoDefined( + propertyInfos, + typeof(ClosingStructuresOutputContext), + typeof(ClosingStructuresOutputProperties)); } } Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/PropertyInfos/ClosingStructuresOutputPropertyInfoTest.cs =================================================================== diff -u --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/PropertyInfos/ClosingStructuresOutputPropertyInfoTest.cs (revision 0) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/PropertyInfos/ClosingStructuresOutputPropertyInfoTest.cs (revision 327fdd939671af52327e89c26a177fa666ba97a9) @@ -0,0 +1,88 @@ +// 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 Rhino.Mocks; +using Ringtoets.ClosingStructures.Data; +using Ringtoets.ClosingStructures.Data.TestUtil; +using Ringtoets.ClosingStructures.Forms.PresentationObjects; +using Ringtoets.ClosingStructures.Forms.PropertyClasses; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Structures; +using Ringtoets.Common.Data.TestUtil; + +namespace Ringtoets.ClosingStructures.Plugin.Test.PropertyInfos +{ + [TestFixture] + public class ClosingStructuresOutputPropertyInfoTest + { + private ClosingStructuresPlugin plugin; + private PropertyInfo info; + + [SetUp] + public void SetUp() + { + plugin = new ClosingStructuresPlugin(); + info = plugin.GetPropertyInfos().First(tni => tni.DataType == typeof(ClosingStructuresOutputContext)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(ClosingStructuresOutputContext), info.DataType); + Assert.AreEqual(typeof(ClosingStructuresOutputProperties), info.PropertyObjectType); + } + + [Test] + public void CreateInstance_ClosingStructuresOutputContext_ReturnClosingStructuresOutputProperties() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new ClosingStructuresFailureMechanism(); + var calculation = new TestClosingStructuresCalculation + { + Output = new StructuresOutput(0, new TestProbabilityAssessmentOutput(), null) + }; + + // Call + IObjectProperties objectProperties = info.CreateInstance(new ClosingStructuresOutputContext(calculation, failureMechanism, assessmentSection)); + + // Assert + Assert.IsInstanceOf(objectProperties); + Assert.AreSame(calculation.Output, objectProperties.Data); + + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/Ringtoets.ClosingStructures.Plugin.Test.csproj =================================================================== diff -u -rfcad48d7beb394e1ac15cfe4289a7381e05aa883 -r327fdd939671af52327e89c26a177fa666ba97a9 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/Ringtoets.ClosingStructures.Plugin.Test.csproj (.../Ringtoets.ClosingStructures.Plugin.Test.csproj) (revision fcad48d7beb394e1ac15cfe4289a7381e05aa883) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/Ringtoets.ClosingStructures.Plugin.Test.csproj (.../Ringtoets.ClosingStructures.Plugin.Test.csproj) (revision 327fdd939671af52327e89c26a177fa666ba97a9) @@ -36,6 +36,7 @@ +