Fisheye: Tag 504f726111ede24adc838a345fdcd1c47227c79b refers to a dead (removed) revision in file `Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSectionComment.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/src/Ringtoets.Common.Data/IAssessmentSection.cs =================================================================== diff -u -r2389ee6ea48d7014101ea90df5db340b44407c12 -r504f726111ede24adc838a345fdcd1c47227c79b --- Ringtoets/Common/src/Ringtoets.Common.Data/IAssessmentSection.cs (.../IAssessmentSection.cs) (revision 2389ee6ea48d7014101ea90df5db340b44407c12) +++ Ringtoets/Common/src/Ringtoets.Common.Data/IAssessmentSection.cs (.../IAssessmentSection.cs) (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -42,7 +42,7 @@ /// /// Gets or sets the comments of the assessment section. /// - AssessmentSectionComment Comments { get; } + string Comments { get; set; } /// /// Gets the composition of the assessment section, e.g. what type of elements can Index: Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj =================================================================== diff -u -r2389ee6ea48d7014101ea90df5db340b44407c12 -r504f726111ede24adc838a345fdcd1c47227c79b --- Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj (.../Ringtoets.Common.Data.csproj) (revision 2389ee6ea48d7014101ea90df5db340b44407c12) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj (.../Ringtoets.Common.Data.csproj) (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -34,7 +34,6 @@ Properties\GlobalAssembly.cs - Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/AssessmentSectionCommentContext.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/AssessmentSectionCommentContext.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/AssessmentSectionCommentContext.cs (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -0,0 +1,52 @@ +// 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; +using Ringtoets.Common.Data; + +namespace Ringtoets.Common.Forms.PresentationObjects +{ + /// + /// This class is a presentation object for the comment of an . + /// + public class AssessmentSectionCommentContext + { + /// + /// Creates a new instance of . + /// + /// The to wrap. + /// Thrown when is null. + public AssessmentSectionCommentContext(IAssessmentSection assessmentSection) + { + if (assessmentSection == null) + { + throw new ArgumentNullException("assessmentSection"); + } + + AssessmentSection = assessmentSection; + } + + /// + /// Gets the wrapped assessment section + /// + public IAssessmentSection AssessmentSection { get; private set; } + } +} Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj =================================================================== diff -u -rc6f57328aeeabd813c96aee9ef763f54b6267214 -r504f726111ede24adc838a345fdcd1c47227c79b --- Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision c6f57328aeeabd813c96aee9ef763f54b6267214) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -43,6 +43,7 @@ Properties\GlobalAssembly.cs + Code Fisheye: Tag 504f726111ede24adc838a345fdcd1c47227c79b refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssessmentSectionCommentTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Ringtoets.Common.Data.Test.csproj =================================================================== diff -u -rf67372a878749b45946b74d08f75f3da3f673a40 -r504f726111ede24adc838a345fdcd1c47227c79b --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Ringtoets.Common.Data.Test.csproj (.../Ringtoets.Common.Data.Test.csproj) (revision f67372a878749b45946b74d08f75f3da3f673a40) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Ringtoets.Common.Data.Test.csproj (.../Ringtoets.Common.Data.Test.csproj) (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -52,7 +52,6 @@ - Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/AssessmentSectionCommentContextTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/AssessmentSectionCommentContextTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/AssessmentSectionCommentContextTest.cs (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -0,0 +1,39 @@ +using System; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data; +using Ringtoets.Common.Forms.PresentationObjects; + +namespace Ringtoets.Common.Forms.Test.PresentationObjects +{ + [TestFixture] + public class AssessmentSectionCommentContextTest + { + [Test] + public void Constuctor_DefaultValues() + { + // Setup + var mocks = new MockRepository(); + var assessmentSectionMock = mocks.StrictMock(); + + mocks.ReplayAll(); + + // Call + var context = new AssessmentSectionCommentContext(assessmentSectionMock); + + // Assert + Assert.AreSame(assessmentSectionMock, context.AssessmentSection); + } + + [Test] + public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new AssessmentSectionCommentContext(null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("assessmentSection", exception.ParamName); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj =================================================================== diff -u -rd49b0c7df08ca616edb5c3945adbb22eab479bf7 -r504f726111ede24adc838a345fdcd1c47227c79b --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision d49b0c7df08ca616edb5c3945adbb22eab479bf7) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -58,6 +58,7 @@ + Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs =================================================================== diff -u -r2389ee6ea48d7014101ea90df5db340b44407c12 -r504f726111ede24adc838a345fdcd1c47227c79b --- Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs (.../AssessmentSection.cs) (revision 2389ee6ea48d7014101ea90df5db340b44407c12) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs (.../AssessmentSection.cs) (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -92,7 +92,6 @@ }; FailureMechanismContribution = new FailureMechanismContribution(GetFailureMechanisms(), 30, 30000); - Comments = new AssessmentSectionComment(); } /// @@ -147,7 +146,7 @@ public string Name { get; set; } - public AssessmentSectionComment Comments { get; private set; } + public string Comments { get; set; } public AssessmentSectionComposition Composition { get; private set; } Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionCommentView.cs =================================================================== diff -u -r30747db7c17738e1e5c6f1f1745d433a14b7fdeb -r504f726111ede24adc838a345fdcd1c47227c79b --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionCommentView.cs (.../AssessmentSectionCommentView.cs) (revision 30747db7c17738e1e5c6f1f1745d433a14b7fdeb) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionCommentView.cs (.../AssessmentSectionCommentView.cs) (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -21,6 +21,7 @@ using System.Windows.Forms; using Core.Common.Controls.Views; +using Ringtoets.Common.Data; namespace Ringtoets.Integration.Forms.Views { @@ -29,14 +30,26 @@ /// public partial class AssessmentSectionCommentView : UserControl, IView { + private object data; + /// /// Creates a new instance of . /// public AssessmentSectionCommentView() { InitializeComponent(); } - - public object Data { get; set; } + + public object Data + { + get + { + return data; + } + set + { + data = value as IAssessmentSection; + } + } } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs =================================================================== diff -u -r3b5fac4302590ba12f652bc55979d7b0ce59fd87 -r504f726111ede24adc838a345fdcd1c47227c79b --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision 3b5fac4302590ba12f652bc55979d7b0ce59fd87) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -112,9 +112,10 @@ AfterCreate = (view, context) => view.FailureMechanism = context.FailureMechanism }; - yield return new ViewInfo + yield return new ViewInfo { GetViewName = (v, o) => RingtoetsCommonDataResources.AssessmentSectionComment_DisplayName, + GetViewData = context => context.AssessmentSection, Image = RingtoetsCommonFormsResources.GenericInputOutputIcon, CloseForData = CloseAssessmentSectionCommentViewForData }; @@ -229,7 +230,7 @@ .Build() }; - yield return new TreeNodeInfo + yield return new TreeNodeInfo { Text = comment => RingtoetsCommonDataResources.AssessmentSectionComment_DisplayName, Image = context => RingtoetsCommonFormsResources.GenericInputOutputIcon, @@ -265,7 +266,7 @@ private static bool CloseAssessmentSectionCommentViewForData(AssessmentSectionCommentView view, object o) { var assessmentSection = o as IAssessmentSection; - return assessmentSection != null && assessmentSection.Comments == view.Data; + return assessmentSection != null && assessmentSection == view.Data; } #endregion @@ -290,7 +291,7 @@ new ReferenceLineContext(nodeData), nodeData.FailureMechanismContribution, new HydraulicBoundaryDatabaseContext(nodeData), - nodeData.Comments + new AssessmentSectionCommentContext(nodeData) }; var failureMechanismContexts = WrapFailureMechanismsInContexts(nodeData); Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/AssessmentSectionTest.cs =================================================================== diff -u -r2389ee6ea48d7014101ea90df5db340b44407c12 -r504f726111ede24adc838a345fdcd1c47227c79b --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/AssessmentSectionTest.cs (.../AssessmentSectionTest.cs) (revision 2389ee6ea48d7014101ea90df5db340b44407c12) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/AssessmentSectionTest.cs (.../AssessmentSectionTest.cs) (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -53,7 +53,7 @@ Assert.IsInstanceOf(section); Assert.AreEqual("Traject", section.Name); - Assert.IsInstanceOf(section.Comments); + Assert.IsNull(section.Comments); Assert.IsNull(section.ReferenceLine); Assert.AreEqual(AssessmentSectionComposition.Dike, section.Composition); Assert.IsInstanceOf(section.FailureMechanismContribution); @@ -118,10 +118,10 @@ const string newValue = "new comment value"; // Call - section.Comments.Text = newValue; + section.Comments = newValue; // Assert - Assert.AreEqual(newValue, section.Comments.Text); + Assert.AreEqual(newValue, section.Comments); } [Test] Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj =================================================================== diff -u -r30747db7c17738e1e5c6f1f1745d433a14b7fdeb -r504f726111ede24adc838a345fdcd1c47227c79b --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 30747db7c17738e1e5c6f1f1745d433a14b7fdeb) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -63,7 +63,7 @@ - + @@ -75,7 +75,7 @@ - + @@ -127,10 +127,6 @@ {e38c11e0-4384-44dd-9f5b-ee73d79fd7f5} Ringtoets.Common.Placeholder - - {888d4097-8bc2-4703-9fb1-8744c94d525e} - Ringtoets.HydraRing.Calculation - {70F8CC9C-5BC8-4FB2-B201-EAE7FA8088C2} Ringtoets.HydraRing.Data Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionCommentContextTreeNodeInfoTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionCommentContextTreeNodeInfoTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionCommentContextTreeNodeInfoTest.cs (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -0,0 +1,151 @@ +// 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.Drawing; +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.Data; +using Ringtoets.Common.Forms.PresentationObjects; +using Ringtoets.Integration.Plugin; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.Integration.Forms.Test.TreeNodeInfos +{ + [TestFixture] + public class AssessmentSectionCommentContextTreeNodeInfoTest + { + private MockRepository mocks; + private RingtoetsGuiPlugin plugin; + private TreeNodeInfo info; + + [SetUp] + public void SetUp() + { + mocks = new MockRepository(); + plugin = new RingtoetsGuiPlugin(); + info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(AssessmentSectionCommentContext)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(AssessmentSectionCommentContext), info.TagType); + Assert.IsNull(info.EnsureVisibleOnCreate); + Assert.IsNull(info.ChildNodeObjects); + 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 + var assessmentSectionMock = mocks.StrictMock(); + var context = new AssessmentSectionCommentContext(assessmentSectionMock); + + mocks.ReplayAll(); + + // Call + var text = info.Text(context); + + // Assert + Assert.AreEqual("Opmerkingen", text); + } + + [Test] + public void Image_Always_ReturnsSetImage() + { + // Setup + var assessmentSectionMock = mocks.StrictMock(); + var context = new AssessmentSectionCommentContext(assessmentSectionMock); + + mocks.ReplayAll(); + + // Call + var image = info.Image(context); + + // Assert + TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.GenericInputOutputIcon, image); + } + + [Test] + public void ForeColor_Always_GrayText() + { + // Setup + var assessmentSectionMock = mocks.StrictMock(); + var context = new AssessmentSectionCommentContext(assessmentSectionMock); + + mocks.ReplayAll(); + + // Call + var color = info.ForeColor(context); + + // Assert + Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), color); + } + + [Test] + public void ContextMenuStrip_Always_CallsBuilder() + { + // Setup + var mocks = new MockRepository(); + var gui = mocks.StrictMultiMock(); + var treeViewControl = mocks.StrictMock(); + var menuBuilderMock = mocks.StrictMock(); + + gui.Expect(g => g.Get(null, treeViewControl)).Return(menuBuilderMock); + + menuBuilderMock.Expect(mb => mb.AddOpenItem()).Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.Build()).Return(null); + + mocks.ReplayAll(); + + plugin.Gui = gui; + + // Call + info.ContextMenuStrip(null, null, treeViewControl); + + // Assert + mocks.VerifyAll(); + } + } +} Fisheye: Tag 504f726111ede24adc838a345fdcd1c47227c79b refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionCommentTreeNodeInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs =================================================================== diff -u -ra7a3af9bffa76922cf344ee2134ad30078de878d -r504f726111ede24adc838a345fdcd1c47227c79b --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs (.../AssessmentSectionTreeNodeInfoTest.cs) (revision a7a3af9bffa76922cf344ee2134ad30078de878d) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs (.../AssessmentSectionTreeNodeInfoTest.cs) (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -140,15 +140,11 @@ new FailureMechanismPlaceholder("A") }; var contribution = new FailureMechanismContribution(failureMechanisms, 10.0, 2); - var comments = new AssessmentSectionComment - { - Text = "some comment" - }; + var comments = "some comment"; var assessmentSection = mocks.Stub(); assessmentSection.Stub(section => section.FailureMechanismContribution).Return(contribution); assessmentSection.Stub(section => section.GetFailureMechanisms()).Return(failureMechanisms); - assessmentSection.Stub(section => section.Comments).Return(comments); mocks.ReplayAll(); // Call @@ -166,6 +162,9 @@ Assert.AreSame(assessmentSection.HydraulicBoundaryDatabase, context.Parent.HydraulicBoundaryDatabase); Assert.AreSame(assessmentSection, context.Parent); + var commentContext = (AssessmentSectionCommentContext)objects[3]; + Assert.AreSame(assessmentSection, commentContext.AssessmentSection); + var pipingFailureMechanismContext = (PipingFailureMechanismContext)objects[4]; Assert.AreSame(failureMechanisms[0], pipingFailureMechanismContext.WrappedData); Assert.AreSame(assessmentSection, pipingFailureMechanismContext.Parent); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionCommentViewTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionCommentViewTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionCommentViewTest.cs (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -0,0 +1,78 @@ +// 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.Windows.Forms; +using Core.Common.Controls.Views; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data; +using Ringtoets.Integration.Forms.Views; + +namespace Ringtoets.Integration.Forms.Test.Views +{ + [TestFixture] + public class AssessmentSectionCommentViewTest + { + [Test] + public void Constructor_DefaultValues() + { + // Call + var view = new AssessmentSectionCommentView(); + + // Assert + Assert.IsInstanceOf(view); + Assert.IsInstanceOf(view); + Assert.IsNull(view.Data); + } + + + [Test] + public void Data_AssessmentSection_DataSet() + { + // Setup + var mocks = new MockRepository(); + var view = new AssessmentSectionCommentView(); + var data = mocks.StrictMock(); + + mocks.ReplayAll(); + + // Call + view.Data = data; + + // Assert + Assert.AreSame(data, view.Data); + } + + [Test] + public void Data_NoAssessmentSection_DataNull() + { + // Setup + var view = new AssessmentSectionCommentView(); + var data = new object(); + + // Call + view.Data = data; + + // Assert + Assert.IsNull(view.Data); + } + } +} Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs =================================================================== diff -u -r2389ee6ea48d7014101ea90df5db340b44407c12 -r504f726111ede24adc838a345fdcd1c47227c79b --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs (.../AssessmentSectionViewTest.cs) (revision 2389ee6ea48d7014101ea90df5db340b44407c12) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs (.../AssessmentSectionViewTest.cs) (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -312,7 +312,7 @@ { public string Name { get; set; } public AssessmentSectionComposition Composition { get; private set; } - public AssessmentSectionComment Comments { get; set; } + public string Comments { get; set; } public ReferenceLine ReferenceLine { get; set; } public FailureMechanismContribution FailureMechanismContribution { get; private set; } public HydraulicBoundaryDatabase HydraulicBoundaryDatabase { get; set; } Fisheye: Tag 504f726111ede24adc838a345fdcd1c47227c79b refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectoinCommentViewTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsGuiPluginTest.cs =================================================================== diff -u -ra7a3af9bffa76922cf344ee2134ad30078de878d -r504f726111ede24adc838a345fdcd1c47227c79b --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsGuiPluginTest.cs (.../RingtoetsGuiPluginTest.cs) (revision a7a3af9bffa76922cf344ee2134ad30078de878d) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsGuiPluginTest.cs (.../RingtoetsGuiPluginTest.cs) (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -89,7 +89,7 @@ Assert.AreEqual(typeof(FailureMechanismResultView), resultViewInfo.ViewType); TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.GenericInputOutputIcon, resultViewInfo.Image); - var commentView = viewInfos.Single(vi => vi.DataType == typeof(AssessmentSectionComment)); + var commentView = viewInfos.Single(vi => vi.DataType == typeof(AssessmentSectionCommentContext)); Assert.AreEqual(typeof(AssessmentSectionCommentView), commentView.ViewType); TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.GenericInputOutputIcon, commentView.Image); } @@ -127,7 +127,7 @@ Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(FailureMechanismContribution))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(HydraulicBoundaryDatabaseContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(FailureMechanismSectionResultContext))); - Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(AssessmentSectionComment))); + Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(AssessmentSectionCommentContext))); } mocks.VerifyAll(); } Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/AssessmentSectionCommentViewInfoTest.cs =================================================================== diff -u -r3b5fac4302590ba12f652bc55979d7b0ce59fd87 -r504f726111ede24adc838a345fdcd1c47227c79b --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/AssessmentSectionCommentViewInfoTest.cs (.../AssessmentSectionCommentViewInfoTest.cs) (revision 3b5fac4302590ba12f652bc55979d7b0ce59fd87) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/AssessmentSectionCommentViewInfoTest.cs (.../AssessmentSectionCommentViewInfoTest.cs) (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -4,6 +4,7 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data; +using Ringtoets.Common.Forms.PresentationObjects; using Ringtoets.Integration.Forms.Views; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; @@ -34,20 +35,20 @@ public void Initialized_Always_ExpectedPropertiesSet() { // Assert - Assert.AreEqual(typeof(AssessmentSectionComment), info.DataType); + Assert.AreEqual(typeof(AssessmentSectionCommentContext), info.DataType); } [Test] public void GetViewName_Always_ReturnsViewName() { // Setup - var comment = new AssessmentSectionComment(); + var assessmentSectionMock = mocks.StrictMock(); var viewMock = mocks.StrictMock(); mocks.ReplayAll(); // Call - var viewName = info.GetViewName(viewMock, comment); + var viewName = info.GetViewName(viewMock, assessmentSectionMock); // Assert Assert.AreEqual("Opmerkingen", viewName); @@ -70,10 +71,20 @@ var dataType = info.DataType; // Assert - Assert.AreEqual(typeof(AssessmentSectionComment), dataType); + Assert.AreEqual(typeof(AssessmentSectionCommentContext), dataType); } [Test] + public void ViewDataType_Always_ReturnViewDataType() + { + // Call + var viewDataType = info.ViewDataType; + + // Assert + Assert.AreEqual(typeof(IAssessmentSection), viewDataType); + } + + [Test] public void Image_Always_ReturnsGenericInputOutputIcon() { // Call @@ -90,7 +101,7 @@ var viewMock = mocks.StrictMock(); var assessmentSectionMock = mocks.Stub(); - viewMock.Expect(vm => vm.Data).Return(assessmentSectionMock.Comments); + viewMock.Expect(vm => vm.Data).Return(assessmentSectionMock); mocks.ReplayAll(); @@ -106,10 +117,10 @@ { // Setup var viewMock = mocks.StrictMock(); - var assessmentSectionMock = mocks.Stub(); - var assessmentSectionMock2 = mocks.Stub(); + var assessmentSectionMock = mocks.StrictMock(); + var assessmentSectionMock2 = mocks.StrictMock(); - viewMock.Expect(vm => vm.Data).Return(assessmentSectionMock2.Comments); + viewMock.Expect(vm => vm.Data).Return(assessmentSectionMock2); mocks.ReplayAll(); Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismContributionViewInfoTest.cs =================================================================== diff -u -r2389ee6ea48d7014101ea90df5db340b44407c12 -r504f726111ede24adc838a345fdcd1c47227c79b --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismContributionViewInfoTest.cs (.../FailureMechanismContributionViewInfoTest.cs) (revision 2389ee6ea48d7014101ea90df5db340b44407c12) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismContributionViewInfoTest.cs (.../FailureMechanismContributionViewInfoTest.cs) (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -132,7 +132,7 @@ } public string Name { get; set; } - public AssessmentSectionComment Comments { get; private set; } + public string Comments { get; set; } public AssessmentSectionComposition Composition { get; private set; } public ReferenceLine ReferenceLine { get; set; } public FailureMechanismContribution FailureMechanismContribution { get; private set; } Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs =================================================================== diff -u -r2389ee6ea48d7014101ea90df5db340b44407c12 -r504f726111ede24adc838a345fdcd1c47227c79b --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision 2389ee6ea48d7014101ea90df5db340b44407c12) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision 504f726111ede24adc838a345fdcd1c47227c79b) @@ -481,7 +481,7 @@ private class TestAssessmentSection : Observable, IAssessmentSection { public string Name { get; set; } - public AssessmentSectionComment Comments { get; set; } + public string Comments { get; set; } public AssessmentSectionComposition Composition { get; private set; } public ReferenceLine ReferenceLine { get; set; } public FailureMechanismContribution FailureMechanismContribution { get; private set; }