Fisheye: Tag 761e768c3934a63eba9c7249c726a241473f6ce6 refers to a dead (removed) revision in file `Riskeer/Common/src/Riskeer.Common.Forms/PresentationObjects/AssessmentSectionStateRootContext.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 761e768c3934a63eba9c7249c726a241473f6ce6 refers to a dead (removed) revision in file `Riskeer/Common/test/Riskeer.Common.Forms.Test/PresentationObjects/AssessmentSectionStateRootContextTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/Integration/src/Riskeer.Integration.Forms/PresentationObjects/AssessmentSectionStateRootContext.cs =================================================================== diff -u --- Riskeer/Integration/src/Riskeer.Integration.Forms/PresentationObjects/AssessmentSectionStateRootContext.cs (revision 0) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/PresentationObjects/AssessmentSectionStateRootContext.cs (revision 761e768c3934a63eba9c7249c726a241473f6ce6) @@ -0,0 +1,43 @@ +// Copyright (C) Stichting Deltares 2021. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer 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 Core.Common.Controls.PresentationObjects; +using Riskeer.Common.Data.AssessmentSection; +using Riskeer.Integration.Data; + +namespace Riskeer.Integration.Forms.PresentationObjects +{ + /// + /// Presentation object for all data required to configure an instance of . + /// + public class AssessmentSectionStateRootContext : ObservableWrappedObjectContextBase + { + /// + /// Creates a new instance of . + /// + /// The which the + /// belongs to. + /// Thrown when is null. + public AssessmentSectionStateRootContext(AssessmentSection wrappedData) + : base(wrappedData) {} + } +} \ No newline at end of file Index: Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PresentationObjects/AssessmentSectionStateRootContextTest.cs =================================================================== diff -u --- Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PresentationObjects/AssessmentSectionStateRootContextTest.cs (revision 0) +++ Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PresentationObjects/AssessmentSectionStateRootContextTest.cs (revision 761e768c3934a63eba9c7249c726a241473f6ce6) @@ -0,0 +1,38 @@ +using System; +using Core.Common.Controls.PresentationObjects; +using NUnit.Framework; +using Riskeer.Common.Data.AssessmentSection; +using Riskeer.Integration.Data; +using Riskeer.Integration.Forms.PresentationObjects; + +namespace Riskeer.Integration.Forms.Test.PresentationObjects +{ + [TestFixture] + public class AssessmentSectionStateRootContextTest + { + [Test] + public void Constructor_ExpectedValues() + { + // Setup + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + + // Call + var context = new AssessmentSectionStateRootContext(assessmentSection); + + // Assert + Assert.IsInstanceOf>(context); + Assert.AreSame(assessmentSection, context.WrappedData); + } + + [Test] + public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() + { + // Call + void Call() => new AssessmentSectionStateRootContext(null); + + // Assert + var exception = Assert.Throws(Call); + Assert.AreEqual("wrappedData", exception.ParamName); + } + } +} \ No newline at end of file Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/AssessmentSectionStateRootContextPropertyInfoTest.cs =================================================================== diff -u --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/AssessmentSectionStateRootContextPropertyInfoTest.cs (revision 0) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/AssessmentSectionStateRootContextPropertyInfoTest.cs (revision 761e768c3934a63eba9c7249c726a241473f6ce6) @@ -0,0 +1,92 @@ +// Copyright (C) Stichting Deltares 2021. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer 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.Gui; +using Core.Gui.Commands; +using Core.Gui.Plugin; +using Core.Gui.PropertyBag; +using NUnit.Framework; +using Rhino.Mocks; +using Riskeer.Common.Data.AssessmentSection; +using Riskeer.Integration.Data; +using Riskeer.Integration.Forms.PresentationObjects; +using Riskeer.Integration.Forms.PropertyClasses; + +namespace Riskeer.Integration.Plugin.Test.PropertyInfos +{ + [TestFixture] + public class AssessmentSectionStateRootContextPropertyInfoTest + { + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Setup + using (var plugin = new RiskeerPlugin()) + { + // Call + PropertyInfo info = GetInfo(plugin); + + // Assert + Assert.AreEqual(typeof(AssessmentSectionStateRootContext), info.DataType); + Assert.AreEqual(typeof(AssessmentSectionProperties), info.PropertyObjectType); + } + } + + [Test] + public void CreateInstance_WithContext_SetsData() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + 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 RiskeerPlugin()) + { + plugin.Gui = gui; + + var context = new AssessmentSectionStateRootContext(assessmentSection); + + PropertyInfo info = GetInfo(plugin); + + // Call + IObjectProperties objectProperties = info.CreateInstance(context); + + // Assert + Assert.IsInstanceOf(objectProperties); + Assert.AreSame(assessmentSection, objectProperties.Data); + } + + mocks.VerifyAll(); + } + + private static PropertyInfo GetInfo(RiskeerPlugin plugin) + { + PropertyInfo[] propertyInfos = plugin.GetPropertyInfos().Where(tni => tni.PropertyObjectType == typeof(AssessmentSectionProperties)).ToArray(); + return propertyInfos[1]; + } + } +} \ No newline at end of file Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/StateInfos/AssessmentSectionStateInfoTest.cs =================================================================== diff -u -r0559c17efc9173756acbac70af3d2cfde37e2f98 -r761e768c3934a63eba9c7249c726a241473f6ce6 --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/StateInfos/AssessmentSectionStateInfoTest.cs (.../AssessmentSectionStateInfoTest.cs) (revision 0559c17efc9173756acbac70af3d2cfde37e2f98) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/StateInfos/AssessmentSectionStateInfoTest.cs (.../AssessmentSectionStateInfoTest.cs) (revision 761e768c3934a63eba9c7249c726a241473f6ce6) @@ -25,8 +25,8 @@ using NUnit.Framework; using Rhino.Mocks; using Riskeer.Common.Data.AssessmentSection; -using Riskeer.Common.Forms.PresentationObjects; using Riskeer.Integration.Data; +using Riskeer.Integration.Forms.PresentationObjects; namespace Riskeer.Integration.Plugin.Test.StateInfos {