Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs =================================================================== diff -u -racb45246d666b955705c808a110fa23f4e650a5c -r1d60e53e7598655a856373fcddb0aa674dc084bd --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs (.../StabilityPointStructuresPlugin.cs) (revision acb45246d666b955705c808a110fa23f4e650a5c) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs (.../StabilityPointStructuresPlugin.cs) (revision 1d60e53e7598655a856373fcddb0aa674dc084bd) @@ -83,6 +83,12 @@ { CreateInstance = context => new StructureCollectionProperties(context.WrappedData) }; + yield return new PropertyInfo + { + CreateInstance = context => new StabilityPointStructuresOutputProperties(context.WrappedData.Output, + context.FailureMechanism, + context.AssessmentSection) + }; } public override IEnumerable GetViewInfos() Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/PropertyInfos/StabilityPointStructuresOutputPropertyInfoTest.cs =================================================================== diff -u --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/PropertyInfos/StabilityPointStructuresOutputPropertyInfoTest.cs (revision 0) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/PropertyInfos/StabilityPointStructuresOutputPropertyInfoTest.cs (revision 1d60e53e7598655a856373fcddb0aa674dc084bd) @@ -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.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Structures; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.StabilityPointStructures.Data.TestUtil; +using Ringtoets.StabilityPointStructures.Forms.PresentationObjects; +using Ringtoets.StabilityPointStructures.Forms.PropertyClasses; + +namespace Ringtoets.StabilityPointStructures.Plugin.Test.PropertyInfos +{ + [TestFixture] + public class StabilityPointStructuresOutputPropertyInfoTest + { + private StabilityPointStructuresPlugin plugin; + private PropertyInfo info; + + [SetUp] + public void SetUp() + { + plugin = new StabilityPointStructuresPlugin(); + info = plugin.GetPropertyInfos().First(tni => tni.DataType == typeof(StabilityPointStructuresOutputContext)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(StabilityPointStructuresOutputContext), info.DataType); + Assert.AreEqual(typeof(StabilityPointStructuresOutputProperties), info.PropertyObjectType); + } + + [Test] + public void CreateInstance_StabilityPointStructuresOutputContext_ReturnStabilityPointStructuresOutputProperties() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + var calculation = new TestStabilityPointStructuresCalculation + { + Output = new StructuresOutput(0, new TestProbabilityAssessmentOutput(), null) + }; + + // Call + IObjectProperties objectProperties = info.CreateInstance(new StabilityPointStructuresOutputContext(calculation, failureMechanism, assessmentSection)); + + // Assert + Assert.IsInstanceOf(objectProperties); + Assert.AreSame(calculation.Output, objectProperties.Data); + + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/Ringtoets.StabilityPointStructures.Plugin.Test.csproj =================================================================== diff -u -rfcad48d7beb394e1ac15cfe4289a7381e05aa883 -r1d60e53e7598655a856373fcddb0aa674dc084bd --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/Ringtoets.StabilityPointStructures.Plugin.Test.csproj (.../Ringtoets.StabilityPointStructures.Plugin.Test.csproj) (revision fcad48d7beb394e1ac15cfe4289a7381e05aa883) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/Ringtoets.StabilityPointStructures.Plugin.Test.csproj (.../Ringtoets.StabilityPointStructures.Plugin.Test.csproj) (revision 1d60e53e7598655a856373fcddb0aa674dc084bd) @@ -35,6 +35,7 @@ + Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/StabilityPointStructuresPluginTest.cs =================================================================== diff -u -r92acb4483676af5adad598c2ea8ca46f9b8379c1 -r1d60e53e7598655a856373fcddb0aa674dc084bd --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/StabilityPointStructuresPluginTest.cs (.../StabilityPointStructuresPluginTest.cs) (revision 92acb4483676af5adad598c2ea8ca46f9b8379c1) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/StabilityPointStructuresPluginTest.cs (.../StabilityPointStructuresPluginTest.cs) (revision 1d60e53e7598655a856373fcddb0aa674dc084bd) @@ -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(StabilityPointStructuresContext), typeof(StructureCollectionProperties)); + + PluginTestHelper.AssertPropertyInfoDefined( + propertyInfos, + typeof(StabilityPointStructuresOutputContext), + typeof(StabilityPointStructuresOutputProperties)); } }