Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/AssessmentSectionStateRootContextViewInfoTest.cs =================================================================== diff -u -r8991dec7387bc19c042b46aceae02b11ce44237c -r1c5bb8a344ba13e3d1a952b26ac771e46f937754 --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/AssessmentSectionStateRootContextViewInfoTest.cs (.../AssessmentSectionStateRootContextViewInfoTest.cs) (revision 8991dec7387bc19c042b46aceae02b11ce44237c) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/AssessmentSectionStateRootContextViewInfoTest.cs (.../AssessmentSectionStateRootContextViewInfoTest.cs) (revision 1c5bb8a344ba13e3d1a952b26ac771e46f937754) @@ -43,7 +43,8 @@ public void SetUp() { plugin = new RiskeerPlugin(); - info = plugin.GetViewInfos().First(tni => tni.ViewType == typeof(AssessmentSectionReferenceLineView)); + info = plugin.GetViewInfos().First(tni => tni.ViewType == typeof(AssessmentSectionReferenceLineView) + && tni.DataType == typeof(AssessmentSectionStateRootContext)); } [TearDown] Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/CalculationsStateRootContextViewInfoTest.cs =================================================================== diff -u --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/CalculationsStateRootContextViewInfoTest.cs (revision 0) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/CalculationsStateRootContextViewInfoTest.cs (revision 1c5bb8a344ba13e3d1a952b26ac771e46f937754) @@ -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 CalculationsStateRootContextViewInfoTest + { + 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(CalculationsStateRootContext)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(CalculationsStateRootContext), 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 CalculationsStateRootContext(new AssessmentSection(AssessmentSectionComposition.Dike)); + + // Call + IView view = info.CreateInstance(calculationsStateRootContext); + + // Assert + Assert.IsInstanceOf(view); + } + } +} \ No newline at end of file