Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/WindDirectionTestFactoryTest.cs =================================================================== diff -u -r47ffe2caa64a35b18c61dfef4b795ab0f0f30bc1 -rc6c404705d2c8ba7c4e380da530f4d9a9aec94f9 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/WindDirectionTestFactoryTest.cs (.../WindDirectionTestFactoryTest.cs) (revision 47ffe2caa64a35b18c61dfef4b795ab0f0f30bc1) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/WindDirectionTestFactoryTest.cs (.../WindDirectionTestFactoryTest.cs) (revision c6c404705d2c8ba7c4e380da530f4d9a9aec94f9) @@ -37,13 +37,12 @@ // Assert Assert.IsInstanceOf(windDirection); - Assert.AreEqual("SSE", windDirection.Name); Assert.AreEqual(5.0, windDirection.Angle, windDirection.Angle.GetAccuracy()); } [Test] - public void CreatesTestWindDirection_WindDirectionNull_ThrowsArgumentNullException() + public void CreateTestWindDirection_WindDirectionNameNull_ThrowsArgumentNullException() { // Call TestDelegate call = () => WindDirectionTestFactory.CreateTestWindDirection(null); @@ -56,7 +55,7 @@ [Test] [TestCase("")] [TestCase("WindDirection")] - public void CreateTestWindDirection_WithWindDirection_ReturnsExpectedProperties(string windDirectionName) + public void CreateTestWindDirection_WithWindDirectionName_ReturnsExpectedProperties(string windDirectionName) { // Call WindDirection windDirection = WindDirectionTestFactory.CreateTestWindDirection(windDirectionName); Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/IllustrationPoints/WindDirectionTestFactory.cs =================================================================== diff -u -r47ffe2caa64a35b18c61dfef4b795ab0f0f30bc1 -rc6c404705d2c8ba7c4e380da530f4d9a9aec94f9 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/IllustrationPoints/WindDirectionTestFactory.cs (.../WindDirectionTestFactory.cs) (revision 47ffe2caa64a35b18c61dfef4b795ab0f0f30bc1) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/IllustrationPoints/WindDirectionTestFactory.cs (.../WindDirectionTestFactory.cs) (revision c6c404705d2c8ba7c4e380da530f4d9a9aec94f9) @@ -40,9 +40,9 @@ } /// - /// /Creates a new instance of with a specified name. + /// Creates a new instance of with a specified name. /// - /// The name of the wind direction + /// The name of the wind direction. /// A which can be readily used for testing. /// Thrown when /// is null. Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/TopLevelSubMechanismIllustrationPointPropertiesTest.cs =================================================================== diff -u -r47ffe2caa64a35b18c61dfef4b795ab0f0f30bc1 -rc6c404705d2c8ba7c4e380da530f4d9a9aec94f9 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/TopLevelSubMechanismIllustrationPointPropertiesTest.cs (.../TopLevelSubMechanismIllustrationPointPropertiesTest.cs) (revision 47ffe2caa64a35b18c61dfef4b795ab0f0f30bc1) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/TopLevelSubMechanismIllustrationPointPropertiesTest.cs (.../TopLevelSubMechanismIllustrationPointPropertiesTest.cs) (revision c6c404705d2c8ba7c4e380da530f4d9a9aec94f9) @@ -266,7 +266,7 @@ } [Test] - public void GetProperties_ValidData_ReturnsExpectedAttributeValues() + public void GetProperties_SameClosingSituations_ReturnsExpectedAttributeValues() { // Setup var context = new TopLevelSubMechanismIllustrationPoint(WindDirectionTestFactory.CreateTestWindDirection(), Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsHydraulicBoundaryLocationContextPropertiesTest.cs =================================================================== diff -u -r47ffe2caa64a35b18c61dfef4b795ab0f0f30bc1 -rc6c404705d2c8ba7c4e380da530f4d9a9aec94f9 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsHydraulicBoundaryLocationContextPropertiesTest.cs (.../GrassCoverErosionOutwardsHydraulicBoundaryLocationContextPropertiesTest.cs) (revision 47ffe2caa64a35b18c61dfef4b795ab0f0f30bc1) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsHydraulicBoundaryLocationContextPropertiesTest.cs (.../GrassCoverErosionOutwardsHydraulicBoundaryLocationContextPropertiesTest.cs) (revision c6c404705d2c8ba7c4e380da530f4d9a9aec94f9) @@ -351,20 +351,14 @@ Assert.AreEqual(nameof(GrassCoverErosionOutwardsHydraulicBoundaryLocationContextProperties.Location), dynamicProperties[2].Name); } - private static void AssertStochast(Stochast stochast, Stochast actualStochast) - { - Assert.AreEqual(stochast.Name, actualStochast.Name); - Assert.AreEqual(stochast.Alpha, actualStochast.Alpha); - Assert.AreEqual(stochast.Duration, actualStochast.Duration); - } - private class TestGrassCoverErosionOutwardsLocationProperties : GrassCoverErosionOutwardsHydraulicBoundaryLocationContextProperties { - public GeneralResult GeneralResult; public TestGrassCoverErosionOutwardsLocationProperties() : base(new ConstructionProperties()) {} public TestGrassCoverErosionOutwardsLocationProperties(ConstructionProperties propertyIndexes) : base(propertyIndexes) {} + public GeneralResult GeneralResult; + protected override GeneralResult GetGeneralResultSubMechanismIllustrationPoints() { return GeneralResult; Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationPropertiesTest.cs =================================================================== diff -u -r47ffe2caa64a35b18c61dfef4b795ab0f0f30bc1 -rc6c404705d2c8ba7c4e380da530f4d9a9aec94f9 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationPropertiesTest.cs (.../HydraulicBoundaryLocationPropertiesTest.cs) (revision 47ffe2caa64a35b18c61dfef4b795ab0f0f30bc1) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationPropertiesTest.cs (.../HydraulicBoundaryLocationPropertiesTest.cs) (revision c6c404705d2c8ba7c4e380da530f4d9a9aec94f9) @@ -310,20 +310,14 @@ Assert.AreEqual(nameof(HydraulicBoundaryLocationProperties.Location), dynamicProperties[2].Name); } - private static void AssertStochast(Stochast stochast, Stochast actualStochast) - { - Assert.AreEqual(stochast.Name, actualStochast.Name); - Assert.AreEqual(stochast.Alpha, actualStochast.Alpha); - Assert.AreEqual(stochast.Duration, actualStochast.Duration); - } - private class TestHydraulicBoundaryLocationProperties : HydraulicBoundaryLocationProperties { - public GeneralResult GeneralResult; public TestHydraulicBoundaryLocationProperties() : base(new ConstructionProperties()) {} public TestHydraulicBoundaryLocationProperties(ConstructionProperties propertyIndexes) : base(propertyIndexes) {} + public GeneralResult GeneralResult; + protected override GeneralResult GetGeneralResultSubMechanismIllustrationPoints() { return GeneralResult; Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/FailureMechanismContributionContextPropertyInfoTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/FailureMechanismContributionContextPropertyInfoTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/FailureMechanismContributionContextPropertyInfoTest.cs (revision c6c404705d2c8ba7c4e380da530f4d9a9aec94f9) @@ -0,0 +1,95 @@ +// 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.Collections.Generic; +using System.Linq; +using Core.Common.Gui; +using Core.Common.Gui.Commands; +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.Contribution; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.PresentationObjects; +using Ringtoets.Integration.Forms.PropertyClasses; + +namespace Ringtoets.Integration.Plugin.Test.PropertyInfos +{ + [TestFixture] + public class FailureMechanismContributionContextPropertyInfoTest + { + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Setup + using (var plugin = new RingtoetsPlugin()) + { + // Call + PropertyInfo info = GetInfo(plugin); + + // Assert + Assert.AreEqual(typeof(FailureMechanismContributionContext), info.DataType); + Assert.AreEqual(typeof(FailureMechanismContributionProperties), info.PropertyObjectType); + } + } + + [Test] + public void CreateInstance_Always_SetsFailureMechanismContributionAsData() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + var viewCommands = mocks.Stub(); + var gui = mocks.Stub(); + gui.Stub(g => g.ViewCommands).Return(viewCommands); + gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); + gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + mocks.ReplayAll(); + + using (var plugin = new RingtoetsPlugin()) + { + plugin.Gui = gui; + + IEnumerable failureMechanisms = Enumerable.Empty(); + var failureMechanismContribution = new FailureMechanismContribution(failureMechanisms, 1.1, 1.0 / 200); + var context = new FailureMechanismContributionContext(failureMechanismContribution, assessmentSection); + + PropertyInfo info = GetInfo(plugin); + + // Call + IObjectProperties objectProperties = info.CreateInstance(context); + + // Assert + Assert.IsInstanceOf(objectProperties); + Assert.AreSame(failureMechanismContribution, objectProperties.Data); + } + + mocks.VerifyAll(); + } + + private static PropertyInfo GetInfo(RingtoetsPlugin plugin) + { + return plugin.GetPropertyInfos().First(tni => tni.PropertyObjectType == typeof(FailureMechanismContributionProperties)); + } + } +} \ No newline at end of file Fisheye: Tag c6c404705d2c8ba7c4e380da530f4d9a9aec94f9 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/FailureMechanismContributionPropertyInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/SelectableTopLevelIllustrationPointPropertyInfoTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/SelectableTopLevelIllustrationPointPropertyInfoTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/SelectableTopLevelIllustrationPointPropertyInfoTest.cs (revision c6c404705d2c8ba7c4e380da530f4d9a9aec94f9) @@ -0,0 +1,93 @@ +// 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.Common.Data.IllustrationPoints; +using Ringtoets.Common.Data.TestUtil.IllustrationPoints; +using Ringtoets.Common.Forms.PresentationObjects; +using Ringtoets.Common.Forms.PropertyClasses; + +namespace Ringtoets.Integration.Plugin.Test.PropertyInfos +{ + [TestFixture] + public class SelectableTopLevelIllustrationPointPropertyInfoTest + { + private RingtoetsPlugin plugin; + private PropertyInfo info; + + [SetUp] + public void SetUp() + { + plugin = new RingtoetsPlugin(); + info = plugin.GetPropertyInfos().First(tni => tni.PropertyObjectType == typeof(TopLevelSubMechanismIllustrationPointProperties)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(SelectableTopLevelIllustrationPoint), info.DataType); + Assert.AreEqual(typeof(TopLevelSubMechanismIllustrationPointProperties), info.PropertyObjectType); + } + + [Test] + public void CreateInstance_TopLevelSubMechanismPointIllustrationPointData_ReturnsTopLevelSubMechanismIllustrationPointProperties() + { + // Setup + var topLevelIllustrationPoint = new TopLevelSubMechanismIllustrationPoint(WindDirectionTestFactory.CreateTestWindDirection(), + string.Empty, + new TestSubMechanismIllustrationPoint()); + + var selectableIllustrationPointData = new SelectableTopLevelIllustrationPoint(topLevelIllustrationPoint, + Enumerable.Empty()); + + // Call + IObjectProperties objectProperties = info.CreateInstance(selectableIllustrationPointData); + + // Assert + Assert.IsInstanceOf(objectProperties); + Assert.AreSame(topLevelIllustrationPoint, objectProperties.Data); + } + + [Test] + public void CreateInstance_TopLevelIllustrationPointData_ReturnsNull() + { + // Setup + var selectableIllustrationPointData = new SelectableTopLevelIllustrationPoint(new TestTopLevelIllustrationPoint(), + Enumerable.Empty()); + + // Call + IObjectProperties objectProperties = info.CreateInstance(selectableIllustrationPointData); + + // Assert + Assert.IsNull(objectProperties); + } + } +} \ No newline at end of file Fisheye: Tag c6c404705d2c8ba7c4e380da530f4d9a9aec94f9 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/SelectableTopLevelIllustrationPointViewPropertyInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj =================================================================== diff -u -rdc47a5630342b99878c03562d46aeea25899f487 -rc6c404705d2c8ba7c4e380da530f4d9a9aec94f9 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision dc47a5630342b99878c03562d46aeea25899f487) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision c6c404705d2c8ba7c4e380da530f4d9a9aec94f9) @@ -84,8 +84,8 @@ - - + +