Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs =================================================================== diff -u -r8dc401612416d696f64ffa9d972c47599bcbba9e -r088018565559b91dddc21fbc06ab8b2bc582ce76 --- Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 8dc401612416d696f64ffa9d972c47599bcbba9e) +++ Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 088018565559b91dddc21fbc06ab8b2bc582ce76) @@ -503,6 +503,13 @@ CreateInstance = context => new AssessmentSectionReferenceLineView(context.WrappedData) }; + yield return new ViewInfo + { + GetViewName = (view, context) => RiskeerFormsResources.AssessmentSectionMap_DisplayName, + Image = RiskeerFormsResources.Map, + CreateInstance = context => new AssessmentSectionReferenceLineView(context.WrappedData) + }; + yield return new ViewInfo { GetViewName = (view, context) => RiskeerFormsResources.AssessmentSectionMap_DisplayName, Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs =================================================================== diff -u -r8dc401612416d696f64ffa9d972c47599bcbba9e -r088018565559b91dddc21fbc06ab8b2bc582ce76 --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs (.../RiskeerPluginTest.cs) (revision 8dc401612416d696f64ffa9d972c47599bcbba9e) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs (.../RiskeerPluginTest.cs) (revision 088018565559b91dddc21fbc06ab8b2bc582ce76) @@ -407,7 +407,7 @@ ViewInfo[] viewInfos = plugin.GetViewInfos().ToArray(); // Assert - Assert.AreEqual(32, viewInfos.Length); + Assert.AreEqual(33, viewInfos.Length); PluginTestHelper.AssertViewInfoDefined( viewInfos, @@ -447,6 +447,11 @@ viewInfos, typeof(CalculationsStateRootContext), typeof(AssessmentSectionReferenceLineView)); + + PluginTestHelper.AssertViewInfoDefined( + viewInfos, + typeof(FailurePathsStateRootContext), + typeof(AssessmentSectionReferenceLineView)); PluginTestHelper.AssertViewInfoDefined( viewInfos, Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/FailurePathsStateRootContextViewInfoTest.cs =================================================================== diff -u --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/FailurePathsStateRootContextViewInfoTest.cs (revision 0) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/FailurePathsStateRootContextViewInfoTest.cs (revision 088018565559b91dddc21fbc06ab8b2bc582ce76) @@ -0,0 +1,96 @@ +// 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.Drawing; +using System.Linq; +using Core.Common.Controls.Views; +using Core.Common.TestUtil; +using Core.Gui.Plugin; +using NUnit.Framework; +using Riskeer.Common.Data.AssessmentSection; +using Riskeer.Integration.Data; +using Riskeer.Integration.Forms.PresentationObjects; +using Riskeer.Integration.Forms.Views; +using RiskeerFormsResources = Riskeer.Integration.Forms.Properties.Resources; + +namespace Riskeer.Integration.Plugin.Test.ViewInfos +{ + [TestFixture] + public class FailurePathsStateRootContextViewInfoTest + { + private RiskeerPlugin plugin; + private ViewInfo info; + + [SetUp] + public void SetUp() + { + plugin = new RiskeerPlugin(); + info = plugin.GetViewInfos().First(tni => tni.ViewType == typeof(AssessmentSectionReferenceLineView) + && tni.DataType == typeof(FailurePathsStateRootContext)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(FailurePathsStateRootContext), info.DataType); + } + + [Test] + public void GetViewName_Always_ReturnsViewName() + { + // Call + string viewName = info.GetViewName(null, null); + + // Assert + Assert.AreEqual("Trajectkaart", viewName); + } + + [Test] + public void Image_Always_ReturnsGenericInputOutputIcon() + { + // Call + Image image = info.Image; + + // Assert + TestHelper.AssertImagesAreEqual(RiskeerFormsResources.Map, image); + } + + [Test] + public void CreateInstance_WithAssessmentSection_ReturnsAssessmentSectionView() + { + // Setup + var calculationsStateRootContext = new FailurePathsStateRootContext(new AssessmentSection(AssessmentSectionComposition.Dike)); + + // Call + IView view = info.CreateInstance(calculationsStateRootContext); + + // Assert + Assert.IsInstanceOf(view); + } + } +} \ No newline at end of file