Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/AssessmentSectionEntityReadExtensions.cs =================================================================== diff -u -rae14c5d4e4624fa87390e6d63bb419c648e12dda -r4a204921c07e423981a5c4c0e51202a9859abe25 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/AssessmentSectionEntityReadExtensions.cs (.../AssessmentSectionEntityReadExtensions.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/AssessmentSectionEntityReadExtensions.cs (.../AssessmentSectionEntityReadExtensions.cs) (revision 4a204921c07e423981a5c4c0e51202a9859abe25) @@ -81,7 +81,7 @@ entity.ReadPipingStructureFailureMechanism(assessmentSection, collector); entity.ReadDuneErosionFailureMechanism(assessmentSection, collector); entity.ReadStabilityStoneCoverFailureMechanism(assessmentSection, collector); - entity.ReadStrengthStabilityPointConstructionFailureMechanism(assessmentSection, collector); + entity.ReadStabilityPointStructuresFailureMechanism(assessmentSection, collector); return assessmentSection; } @@ -269,12 +269,12 @@ } } - private static void ReadStrengthStabilityPointConstructionFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + private static void ReadStabilityPointStructuresFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) { - var strengthStabilityPointConstructionFailureMechanismEntity = entity.FailureMechanismEntities.SingleOrDefault(fme => fme.FailureMechanismType == (int) FailureMechanismType.StabilityPointStructures); - if (strengthStabilityPointConstructionFailureMechanismEntity != null) + var stabilityPointStructuresFailureMechanismEntity = entity.FailureMechanismEntities.SingleOrDefault(fme => fme.FailureMechanismType == (int)FailureMechanismType.StabilityPointStructures); + if (stabilityPointStructuresFailureMechanismEntity != null) { - strengthStabilityPointConstructionFailureMechanismEntity.ReadAsStabilityPointStructuresFailureMechanism(assessmentSection.StabilityPointStructures, collector); + stabilityPointStructuresFailureMechanismEntity.ReadAsStabilityPointStructuresFailureMechanism(assessmentSection.StabilityPointStructures, collector); } } } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs =================================================================== diff -u -rae14c5d4e4624fa87390e6d63bb419c648e12dda -r4a204921c07e423981a5c4c0e51202a9859abe25 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs (.../FailureMechanismEntityReadExtensions.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs (.../FailureMechanismEntityReadExtensions.cs) (revision 4a204921c07e423981a5c4c0e51202a9859abe25) @@ -676,9 +676,9 @@ #region Stability Point Structures /// - /// Read the and use the information to update a . + /// Read the and use the information to update a . /// - /// The to create for. + /// The to create for. /// The target of the read operation. /// The object keeping track of read operations. internal static void ReadAsStabilityPointStructuresFailureMechanism(this FailureMechanismEntity entity, StabilityPointStructuresFailureMechanism failureMechanism, ReadConversionCollector collector) Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/AssessmentSectionTest.cs =================================================================== diff -u -rae14c5d4e4624fa87390e6d63bb419c648e12dda -r4a204921c07e423981a5c4c0e51202a9859abe25 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/AssessmentSectionTest.cs (.../AssessmentSectionTest.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/AssessmentSectionTest.cs (.../AssessmentSectionTest.cs) (revision 4a204921c07e423981a5c4c0e51202a9859abe25) @@ -55,7 +55,7 @@ const string heightStructuresName = "Kunstwerken - Hoogte kunstwerk"; const string closingStructuresName = "Kunstwerken - Betrouwbaarheid sluiting kunstwerk"; const string pipingStructuresName = "Kunstwerken - Piping bij kunstwerk"; - const string strengthStabilityPointConstructionName = "Kunstwerken - Sterkte en stabiliteit puntconstructies"; + const string stabilityPointStructuresName = "Kunstwerken - Sterkte en stabiliteit puntconstructies"; const string duneErosionName = "Duinwaterkering - Duinafslag"; const string otherName = "Overig"; @@ -69,7 +69,7 @@ const string heightStructuresCode = "HTKW"; const string closingStructuresCode = "BSKW"; const string pipingStructuresCode = "PKW"; - const string strengthStabilityPointConstructionCode = "STKWp"; + const string stabilityPointStructuresCode = "STKWp"; const string duneErosionCode = "DA"; const string otherCode = "-"; @@ -85,7 +85,7 @@ heightStructuresName, closingStructuresName, pipingStructuresName, - strengthStabilityPointConstructionName, + stabilityPointStructuresName, duneErosionName, otherName }; @@ -102,7 +102,7 @@ heightStructuresCode, closingStructuresCode, pipingStructuresCode, - strengthStabilityPointConstructionCode, + stabilityPointStructuresCode, duneErosionCode, otherCode }; Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj =================================================================== diff -u -rae14c5d4e4624fa87390e6d63bb419c648e12dda -r4a204921c07e423981a5c4c0e51202a9859abe25 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 4a204921c07e423981a5c4c0e51202a9859abe25) @@ -113,7 +113,7 @@ - + Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs =================================================================== diff -u -rae14c5d4e4624fa87390e6d63bb419c648e12dda -r4a204921c07e423981a5c4c0e51202a9859abe25 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs (.../AssessmentSectionTreeNodeInfoTest.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs (.../AssessmentSectionTreeNodeInfoTest.cs) (revision 4a204921c07e423981a5c4c0e51202a9859abe25) @@ -215,9 +215,9 @@ var pipingStructureFailureMechanismContext = (FailureMechanismContext)objects[17]; Assert.AreSame(assessmentSection.PipingStructure, pipingStructureFailureMechanismContext.WrappedData); Assert.AreSame(assessmentSection, pipingStructureFailureMechanismContext.Parent); - var strengthStabilityPointConstructionFailureMechanismContext = (FailureMechanismContext)objects[18]; - Assert.AreSame(assessmentSection.StabilityPointStructures, strengthStabilityPointConstructionFailureMechanismContext.WrappedData); - Assert.AreSame(assessmentSection, strengthStabilityPointConstructionFailureMechanismContext.Parent); + var stabilityPointStructuresFailureMechanismContext = (FailureMechanismContext)objects[18]; + Assert.AreSame(assessmentSection.StabilityPointStructures, stabilityPointStructuresFailureMechanismContext.WrappedData); + Assert.AreSame(assessmentSection, stabilityPointStructuresFailureMechanismContext.Parent); var strengthStabilityLengthwiseConstructionFailureMechanismContext = (FailureMechanismContext)objects[19]; Assert.AreSame(assessmentSection.StrengthStabilityLengthwiseConstruction, strengthStabilityLengthwiseConstructionFailureMechanismContext.WrappedData); Assert.AreSame(assessmentSection, strengthStabilityLengthwiseConstructionFailureMechanismContext.Parent); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/StabilityPointStructuresFailureMechanismSectionResultContextTreeNodeInfoTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/StabilityPointStructuresFailureMechanismSectionResultContextTreeNodeInfoTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/StabilityPointStructuresFailureMechanismSectionResultContextTreeNodeInfoTest.cs (revision 4a204921c07e423981a5c4c0e51202a9859abe25) @@ -0,0 +1,138 @@ +// Copyright (C) Stichting Deltares 2016. 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.Controls.TreeView; +using Core.Common.Gui; +using Core.Common.Gui.ContextMenu; +using Core.Common.TestUtil; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Forms.PresentationObjects; +using Ringtoets.Common.Forms.Properties; +using Ringtoets.Integration.Plugin; +using Ringtoets.StabilityPointStructures.Data; + +namespace Ringtoets.Integration.Forms.Test.TreeNodeInfos +{ + [TestFixture] + public class StabilityPointStructuresFailureMechanismSectionResultContextTreeNodeInfoTest + { + private MockRepository mocks; + private RingtoetsPlugin plugin; + private TreeNodeInfo info; + + [SetUp] + public void SetUp() + { + mocks = new MockRepository(); + plugin = new RingtoetsPlugin(); + info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(FailureMechanismSectionResultContext)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + mocks.VerifyAll(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Setup + mocks.ReplayAll(); + + // Assert + Assert.AreEqual(typeof(FailureMechanismSectionResultContext), info.TagType); + + Assert.IsNull(info.ChildNodeObjects); + Assert.IsNull(info.ForeColor); + Assert.IsNull(info.EnsureVisibleOnCreate); + Assert.IsNull(info.CanRename); + Assert.IsNull(info.OnNodeRenamed); + Assert.IsNull(info.CanRemove); + Assert.IsNull(info.OnNodeRemoved); + Assert.IsNull(info.CanCheck); + Assert.IsNull(info.IsChecked); + Assert.IsNull(info.OnNodeChecked); + Assert.IsNull(info.CanDrag); + Assert.IsNull(info.CanDrop); + Assert.IsNull(info.CanInsert); + Assert.IsNull(info.OnDrop); + } + + [Test] + public void Text_Always_ReturnsName() + { + // Setup + mocks.ReplayAll(); + + var mechanism = new StabilityPointStructuresFailureMechanism(); + var context = new FailureMechanismSectionResultContext(mechanism.SectionResults, mechanism); + + // Call + var text = info.Text(context); + + // Assert + Assert.AreEqual("Resultaat", text); + } + + [Test] + public void Image_Always_ReturnsGenericInputOutputIcon() + { + // Setup + mocks.ReplayAll(); + + // Call + var image = info.Image(null); + + // Assert + TestHelper.AssertImagesAreEqual(Resources.FailureMechanismSectionResultIcon, image); + } + + [Test] + public void ContextMenuStrip_Always_CallsBuilder() + { + // Setup + var menuBuilderMock = mocks.StrictMock(); + menuBuilderMock.Expect(mb => mb.AddOpenItem()).Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.Build()).Return(null); + + using (var treeViewControl = new TreeViewControl()) + { + var gui = mocks.Stub(); + gui.Stub(g => g.Get(null, treeViewControl)).Return(menuBuilderMock); + gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); + gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + + mocks.ReplayAll(); + + plugin.Gui = gui; + + // Call + info.ContextMenuStrip(null, null, treeViewControl); + } + // Assert + // Assert expectancies are called in TearDown() + } + } +} \ No newline at end of file Fisheye: Tag 4a204921c07e423981a5c4c0e51202a9859abe25 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/StrengthStabilityPointwiseConstructionFailureMechanismSectionResultContextTreeNodeInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs =================================================================== diff -u -rae14c5d4e4624fa87390e6d63bb419c648e12dda -r4a204921c07e423981a5c4c0e51202a9859abe25 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 4a204921c07e423981a5c4c0e51202a9859abe25) @@ -378,10 +378,10 @@ Assert.AreEqual(typeof(MacrostabilityInwardsResultView), macrostabilityInwardsResultViewInfo.ViewType); TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.FailureMechanismSectionResultIcon, macrostabilityInwardsResultViewInfo.Image); - var strengthStabilityPointConstructionResultViewInfo = viewInfos.Single(vi => vi.DataType == typeof(FailureMechanismSectionResultContext)); - Assert.AreEqual(typeof(IEnumerable), strengthStabilityPointConstructionResultViewInfo.ViewDataType); - Assert.AreEqual(typeof(StabilityPointStructuresResultView), strengthStabilityPointConstructionResultViewInfo.ViewType); - TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.FailureMechanismSectionResultIcon, strengthStabilityPointConstructionResultViewInfo.Image); + var stabilityPointStructuresResultViewInfo = viewInfos.Single(vi => vi.DataType == typeof(FailureMechanismSectionResultContext)); + Assert.AreEqual(typeof(IEnumerable), stabilityPointStructuresResultViewInfo.ViewDataType); + Assert.AreEqual(typeof(StabilityPointStructuresResultView), stabilityPointStructuresResultViewInfo.ViewType); + TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.FailureMechanismSectionResultIcon, stabilityPointStructuresResultViewInfo.Image); var duneErosionResultViewInfo = viewInfos.Single(vi => vi.DataType == typeof(FailureMechanismSectionResultContext)); Assert.AreEqual(typeof(IEnumerable), duneErosionResultViewInfo.ViewDataType);