Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/StateInfos/AssemblyStateInfoTest.cs =================================================================== diff -u --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/StateInfos/AssemblyStateInfoTest.cs (revision 0) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/StateInfos/AssemblyStateInfoTest.cs (revision ec69acb95bfbd2c7686df7ddfbed9f373c1b3db4) @@ -0,0 +1,98 @@ +// 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.Common.Base.Data; +using Core.Gui.Plugin; +using NUnit.Framework; +using Rhino.Mocks; +using Riskeer.Common.Data.AssessmentSection; +using Riskeer.Integration.Data; + +namespace Riskeer.Integration.Plugin.Test.StateInfos +{ + [TestFixture] + public class AssemblyStateInfoTest + { + private RiskeerPlugin plugin; + private StateInfo info; + + [SetUp] + public void SetUp() + { + plugin = new RiskeerPlugin(); + info = plugin.GetStateInfos().First(si => si.Name == "Assembleren"); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual("\uE94B", info.Symbol); + } + + [Test] + public void GetRootData_RiskeerProject_ReturnsExpectedRootData() + { + // Setup + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + var project = new RiskeerProject + { + AssessmentSections = + { + assessmentSection + } + }; + + // Call + object rootData = info.GetRootData(project); + + // Assert + var rootDataCollection = rootData as object[]; + Assert.IsNotNull(rootDataCollection); + Assert.AreEqual(4, rootDataCollection.Length); + } + + [Test] + public void GetRootData_ProjectMock_ReturnsNull() + { + // Setup + var mockRepository = new MockRepository(); + var project = mockRepository.StrictMock(); + + mockRepository.ReplayAll(); + + // Call + object rootData = info.GetRootData(project); + + // Assert + Assert.IsNull(rootData); + + mockRepository.VerifyAll(); + } + } +} \ No newline at end of file Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/StateInfos/AssessmentSectionStateInfoTest.cs =================================================================== diff -u -r3b83d728a220e9fa9f8715b65fdb07b77ae4c9d6 -rec69acb95bfbd2c7686df7ddfbed9f373c1b3db4 --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/StateInfos/AssessmentSectionStateInfoTest.cs (.../AssessmentSectionStateInfoTest.cs) (revision 3b83d728a220e9fa9f8715b65fdb07b77ae4c9d6) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/StateInfos/AssessmentSectionStateInfoTest.cs (.../AssessmentSectionStateInfoTest.cs) (revision ec69acb95bfbd2c7686df7ddfbed9f373c1b3db4) @@ -1,4 +1,25 @@ -using System.Linq; +// 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.Common.Base.Data; using Core.Gui.Plugin; using NUnit.Framework; Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/StateInfos/CalculationsStateInfoTest.cs =================================================================== diff -u --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/StateInfos/CalculationsStateInfoTest.cs (revision 0) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/StateInfos/CalculationsStateInfoTest.cs (revision ec69acb95bfbd2c7686df7ddfbed9f373c1b3db4) @@ -0,0 +1,98 @@ +// 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.Common.Base.Data; +using Core.Gui.Plugin; +using NUnit.Framework; +using Rhino.Mocks; +using Riskeer.Common.Data.AssessmentSection; +using Riskeer.Integration.Data; + +namespace Riskeer.Integration.Plugin.Test.StateInfos +{ + [TestFixture] + public class CalculationsStateInfoTest + { + private RiskeerPlugin plugin; + private StateInfo info; + + [SetUp] + public void SetUp() + { + plugin = new RiskeerPlugin(); + info = plugin.GetStateInfos().First(si => si.Name == "Berekeningen"); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual("\uE91D", info.Symbol); + } + + [Test] + public void GetRootData_RiskeerProject_ReturnsExpectedRootData() + { + // Setup + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + var project = new RiskeerProject + { + AssessmentSections = + { + assessmentSection + } + }; + + // Call + object rootData = info.GetRootData(project); + + // Assert + var rootDataCollection = rootData as object[]; + Assert.IsNotNull(rootDataCollection); + Assert.AreEqual(10, rootDataCollection.Length); + } + + [Test] + public void GetRootData_ProjectMock_ReturnsNull() + { + // Setup + var mockRepository = new MockRepository(); + var project = mockRepository.StrictMock(); + + mockRepository.ReplayAll(); + + // Call + object rootData = info.GetRootData(project); + + // Assert + Assert.IsNull(rootData); + + mockRepository.VerifyAll(); + } + } +} \ No newline at end of file Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/StateInfos/FailurePathsStateInfoTest.cs =================================================================== diff -u --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/StateInfos/FailurePathsStateInfoTest.cs (revision 0) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/StateInfos/FailurePathsStateInfoTest.cs (revision ec69acb95bfbd2c7686df7ddfbed9f373c1b3db4) @@ -0,0 +1,98 @@ +// 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.Common.Base.Data; +using Core.Gui.Plugin; +using NUnit.Framework; +using Rhino.Mocks; +using Riskeer.Common.Data.AssessmentSection; +using Riskeer.Integration.Data; + +namespace Riskeer.Integration.Plugin.Test.StateInfos +{ + [TestFixture] + public class FailurePathsStateInfoTest + { + private RiskeerPlugin plugin; + private StateInfo info; + + [SetUp] + public void SetUp() + { + plugin = new RiskeerPlugin(); + info = plugin.GetStateInfos().First(si => si.Name == "Faalpaden"); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual("\uE953", info.Symbol); + } + + [Test] + public void GetRootData_RiskeerProject_ReturnsExpectedRootData() + { + // Setup + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + var project = new RiskeerProject + { + AssessmentSections = + { + assessmentSection + } + }; + + // Call + object rootData = info.GetRootData(project); + + // Assert + var rootDataCollection = rootData as object[]; + Assert.IsNotNull(rootDataCollection); + Assert.AreEqual(8, rootDataCollection.Length); + } + + [Test] + public void GetRootData_ProjectMock_ReturnsNull() + { + // Setup + var mockRepository = new MockRepository(); + var project = mockRepository.StrictMock(); + + mockRepository.ReplayAll(); + + // Call + object rootData = info.GetRootData(project); + + // Assert + Assert.IsNull(rootData); + + mockRepository.VerifyAll(); + } + } +} \ No newline at end of file