Index: Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/IAssessmentSection.cs =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -r5ef5e3e186036b4985798236624d86b2801b87d3 --- Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/IAssessmentSection.cs (.../IAssessmentSection.cs) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/IAssessmentSection.cs (.../IAssessmentSection.cs) (revision 5ef5e3e186036b4985798236624d86b2801b87d3) @@ -31,19 +31,14 @@ /// /// Base implementation of assessment sections. /// - public interface IAssessmentSection : IObservable, IStorable + public interface IAssessmentSection : IComment, IObservable, IStorable { /// /// Gets or sets the name of the assessment section. /// string Name { get; set; } /// - /// Gets or sets the comments of the assessment section. - /// - string Comments { get; set; } - - /// /// Gets the composition of the assessment section, e.g. what type of elements can /// be found within the assessment section. /// Index: Ringtoets/Common/src/Ringtoets.Common.Data/IComment.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Data/IComment.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Data/IComment.cs (revision 5ef5e3e186036b4985798236624d86b2801b87d3) @@ -0,0 +1,34 @@ +// 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. + +namespace Ringtoets.Common.Data +{ + /// + /// Base implementation of the comments. + /// + public interface IComment + { + /// + /// Gets or sets the comments of the assessment section. + /// + string Comments { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -r5ef5e3e186036b4985798236624d86b2801b87d3 --- Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj (.../Ringtoets.Common.Data.csproj) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj (.../Ringtoets.Common.Data.csproj) (revision 5ef5e3e186036b4985798236624d86b2801b87d3) @@ -45,6 +45,7 @@ + True Fisheye: Tag 5ef5e3e186036b4985798236624d86b2801b87d3 refers to a dead (removed) revision in file `Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/AssessmentSectionCommentContext.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/CommentContext.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/CommentContext.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/CommentContext.cs (revision 5ef5e3e186036b4985798236624d86b2801b87d3) @@ -0,0 +1,51 @@ +// 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 . + /// + public class CommentContext where T : IComment + { + /// + /// Creates a new instance of . + /// + /// The container to wrap. + /// Thrown when is null. + public CommentContext(T commentContainer) + { + if (commentContainer == null) + { + throw new ArgumentNullException("commentContainer"); + } + CommentContainer = commentContainer; + } + + /// + /// Gets the wrapped comment container. + /// + public T CommentContainer { get; private set; } + } +} Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj =================================================================== diff -u -rc8eb333514adae8495778ed16c71c41a6eb4251b -r5ef5e3e186036b4985798236624d86b2801b87d3 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision c8eb333514adae8495778ed16c71c41a6eb4251b) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision 5ef5e3e186036b4985798236624d86b2801b87d3) @@ -43,7 +43,7 @@ Properties\GlobalAssembly.cs - + Code Fisheye: Tag 5ef5e3e186036b4985798236624d86b2801b87d3 refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/AssessmentSectionCommentContextTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/CommentContextTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/CommentContextTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/CommentContextTest.cs (revision 5ef5e3e186036b4985798236624d86b2801b87d3) @@ -0,0 +1,39 @@ +using System; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Forms.PresentationObjects; + +namespace Ringtoets.Common.Forms.Test.PresentationObjects +{ + [TestFixture] + public class CommentContextTest + { + [Test] + public void Constuctor_DefaultValues() + { + // Setup + var mocks = new MockRepository(); + var assessmentSectionMock = mocks.StrictMock(); + + mocks.ReplayAll(); + + // Call + var context = new CommentContext(assessmentSectionMock); + + // Assert + Assert.AreSame(assessmentSectionMock, context.CommentContainer); + } + + [Test] + public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new CommentContext(null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("commentContainer", exception.ParamName); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj =================================================================== diff -u -rc8eb333514adae8495778ed16c71c41a6eb4251b -r5ef5e3e186036b4985798236624d86b2801b87d3 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision c8eb333514adae8495778ed16c71c41a6eb4251b) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision 5ef5e3e186036b4985798236624d86b2801b87d3) @@ -58,7 +58,7 @@ - + Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -r5ef5e3e186036b4985798236624d86b2801b87d3 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision 5ef5e3e186036b4985798236624d86b2801b87d3) @@ -114,10 +114,10 @@ AfterCreate = (view, context) => view.FailureMechanism = context.FailureMechanism }; - yield return new ViewInfo + yield return new ViewInfo, IComment, AssessmentSectionCommentView> { GetViewName = (v, o) => RingtoetsCommonDataResources.AssessmentSectionComment_DisplayName, - GetViewData = context => context.AssessmentSection, + GetViewData = context => context.CommentContainer, Image = RingtoetsCommonFormsResources.GenericInputOutputIcon, CloseForData = CloseAssessmentSectionCommentViewForData }; @@ -232,7 +232,7 @@ .Build() }; - yield return new TreeNodeInfo + yield return new TreeNodeInfo> { Text = comment => RingtoetsCommonDataResources.AssessmentSectionComment_DisplayName, Image = context => RingtoetsCommonFormsResources.GenericInputOutputIcon, @@ -293,7 +293,7 @@ new ReferenceLineContext(nodeData), new FailureMechanismContributionContext(nodeData.FailureMechanismContribution, nodeData), new HydraulicBoundaryDatabaseContext(nodeData), - new AssessmentSectionCommentContext(nodeData) + new CommentContext(nodeData) }; var failureMechanismContexts = WrapFailureMechanismsInContexts(nodeData); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionCommentContextTreeNodeInfoTest.cs =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -r5ef5e3e186036b4985798236624d86b2801b87d3 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionCommentContextTreeNodeInfoTest.cs (.../AssessmentSectionCommentContextTreeNodeInfoTest.cs) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionCommentContextTreeNodeInfoTest.cs (.../AssessmentSectionCommentContextTreeNodeInfoTest.cs) (revision 5ef5e3e186036b4985798236624d86b2801b87d3) @@ -47,7 +47,7 @@ { mocks = new MockRepository(); plugin = new RingtoetsGuiPlugin(); - info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(AssessmentSectionCommentContext)); + info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(CommentContext)); } [TearDown] @@ -60,7 +60,7 @@ public void Initialized_Always_ExpectedPropertiesSet() { // Assert - Assert.AreEqual(typeof(AssessmentSectionCommentContext), info.TagType); + Assert.AreEqual(typeof(CommentContext), info.TagType); Assert.IsNull(info.EnsureVisibleOnCreate); Assert.IsNull(info.ChildNodeObjects); Assert.IsNull(info.CanRename); @@ -82,7 +82,7 @@ { // Setup var assessmentSectionMock = mocks.StrictMock(); - var context = new AssessmentSectionCommentContext(assessmentSectionMock); + var context = new CommentContext(assessmentSectionMock); mocks.ReplayAll(); @@ -98,7 +98,7 @@ { // Setup var assessmentSectionMock = mocks.StrictMock(); - var context = new AssessmentSectionCommentContext(assessmentSectionMock); + var context = new CommentContext(assessmentSectionMock); mocks.ReplayAll(); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -r5ef5e3e186036b4985798236624d86b2801b87d3 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs (.../AssessmentSectionTreeNodeInfoTest.cs) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs (.../AssessmentSectionTreeNodeInfoTest.cs) (revision 5ef5e3e186036b4985798236624d86b2801b87d3) @@ -166,8 +166,8 @@ Assert.AreSame(assessmentSection.HydraulicBoundaryDatabase, context.Parent.HydraulicBoundaryDatabase); Assert.AreSame(assessmentSection, context.Parent); - var commentContext = (AssessmentSectionCommentContext)objects[3]; - Assert.AreSame(assessmentSection, commentContext.AssessmentSection); + var commentContext = (CommentContext)objects[3]; + Assert.AreSame(assessmentSection, commentContext.CommentContainer); var pipingFailureMechanismContext = (PipingFailureMechanismContext)objects[4]; Assert.AreSame(failureMechanisms[0], pipingFailureMechanismContext.WrappedData); Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsGuiPluginTest.cs =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -r5ef5e3e186036b4985798236624d86b2801b87d3 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsGuiPluginTest.cs (.../RingtoetsGuiPluginTest.cs) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsGuiPluginTest.cs (.../RingtoetsGuiPluginTest.cs) (revision 5ef5e3e186036b4985798236624d86b2801b87d3) @@ -91,7 +91,7 @@ Assert.AreEqual(typeof(FailureMechanismResultView), resultViewInfo.ViewType); TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.GenericInputOutputIcon, resultViewInfo.Image); - var commentView = viewInfos.Single(vi => vi.DataType == typeof(AssessmentSectionCommentContext)); + var commentView = viewInfos.Single(vi => vi.DataType == typeof(CommentContext)); Assert.AreEqual(typeof(AssessmentSectionCommentView), commentView.ViewType); TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.GenericInputOutputIcon, commentView.Image); } @@ -129,7 +129,7 @@ Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(FailureMechanismContributionContext))); 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(AssessmentSectionCommentContext))); + Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(CommentContext))); } mocks.VerifyAll(); } Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/AssessmentSectionCommentViewInfoTest.cs =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -r5ef5e3e186036b4985798236624d86b2801b87d3 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/AssessmentSectionCommentViewInfoTest.cs (.../AssessmentSectionCommentViewInfoTest.cs) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/AssessmentSectionCommentViewInfoTest.cs (.../AssessmentSectionCommentViewInfoTest.cs) (revision 5ef5e3e186036b4985798236624d86b2801b87d3) @@ -36,7 +36,7 @@ public void Initialized_Always_ExpectedPropertiesSet() { // Assert - Assert.AreEqual(typeof(AssessmentSectionCommentContext), info.DataType); + Assert.AreEqual(typeof(CommentContext), info.DataType); } [Test] @@ -72,7 +72,7 @@ var dataType = info.DataType; // Assert - Assert.AreEqual(typeof(AssessmentSectionCommentContext), dataType); + Assert.AreEqual(typeof(CommentContext), dataType); } [Test] @@ -82,7 +82,7 @@ var viewDataType = info.ViewDataType; // Assert - Assert.AreEqual(typeof(IAssessmentSection), viewDataType); + Assert.AreEqual(typeof(IComment), viewDataType); } [Test]