Fisheye: Tag 4657c1cd3629ca7330a5e9da02bcec60127509f3 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.TestUtil/PropertiesTestHelper.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 4657c1cd3629ca7330a5e9da02bcec60127509f3 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.TestUtil/TestPlugin.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Gui/test/Core.Gui.Test/Forms/MainWindow/MainWindowTest.cs =================================================================== diff -u -r781a97409ffc49e5b666a7856f633f46178056df -r4657c1cd3629ca7330a5e9da02bcec60127509f3 --- Core/Gui/test/Core.Gui.Test/Forms/MainWindow/MainWindowTest.cs (.../MainWindowTest.cs) (revision 781a97409ffc49e5b666a7856f633f46178056df) +++ Core/Gui/test/Core.Gui.Test/Forms/MainWindow/MainWindowTest.cs (.../MainWindowTest.cs) (revision 4657c1cd3629ca7330a5e9da02bcec60127509f3) @@ -37,6 +37,7 @@ using Core.Gui.Plugin; using Core.Gui.PropertyBag; using Core.Gui.Settings; +using Core.Gui.TestUtil; using NUnit.Framework; using Rhino.Mocks; Index: Core/Gui/test/Core.Gui.Test/GuiCoreTest.cs =================================================================== diff -u -r781a97409ffc49e5b666a7856f633f46178056df -r4657c1cd3629ca7330a5e9da02bcec60127509f3 --- Core/Gui/test/Core.Gui.Test/GuiCoreTest.cs (.../GuiCoreTest.cs) (revision 781a97409ffc49e5b666a7856f633f46178056df) +++ Core/Gui/test/Core.Gui.Test/GuiCoreTest.cs (.../GuiCoreTest.cs) (revision 4657c1cd3629ca7330a5e9da02bcec60127509f3) @@ -41,6 +41,7 @@ using Core.Gui.Forms.ViewHost; using Core.Gui.Plugin; using Core.Gui.Settings; +using Core.Gui.TestUtil; using log4net; using log4net.Appender; using log4net.Repository.Hierarchy; Index: Core/Gui/test/Core.Gui.Test/PropertyBag/DynamicPropertyBagTest.cs =================================================================== diff -u -r781a97409ffc49e5b666a7856f633f46178056df -r4657c1cd3629ca7330a5e9da02bcec60127509f3 --- Core/Gui/test/Core.Gui.Test/PropertyBag/DynamicPropertyBagTest.cs (.../DynamicPropertyBagTest.cs) (revision 781a97409ffc49e5b666a7856f633f46178056df) +++ Core/Gui/test/Core.Gui.Test/PropertyBag/DynamicPropertyBagTest.cs (.../DynamicPropertyBagTest.cs) (revision 4657c1cd3629ca7330a5e9da02bcec60127509f3) @@ -26,6 +26,7 @@ using Core.Common.TestUtil; using Core.Gui.Attributes; using Core.Gui.PropertyBag; +using Core.Gui.TestUtil; using NUnit.Framework; using CategoryAttribute = System.ComponentModel.CategoryAttribute; Index: Core/Gui/test/Core.Gui.TestUtil/Core.Gui.TestUtil.csproj =================================================================== diff -u -rde83556154a382cf617783426d7c36ebfa91698a -r4657c1cd3629ca7330a5e9da02bcec60127509f3 --- Core/Gui/test/Core.Gui.TestUtil/Core.Gui.TestUtil.csproj (.../Core.Gui.TestUtil.csproj) (revision de83556154a382cf617783426d7c36ebfa91698a) +++ Core/Gui/test/Core.Gui.TestUtil/Core.Gui.TestUtil.csproj (.../Core.Gui.TestUtil.csproj) (revision 4657c1cd3629ca7330a5e9da02bcec60127509f3) @@ -6,6 +6,8 @@ + + Index: Core/Gui/test/Core.Gui.TestUtil/PropertiesTestHelper.cs =================================================================== diff -u --- Core/Gui/test/Core.Gui.TestUtil/PropertiesTestHelper.cs (revision 0) +++ Core/Gui/test/Core.Gui.TestUtil/PropertiesTestHelper.cs (revision 4657c1cd3629ca7330a5e9da02bcec60127509f3) @@ -0,0 +1,70 @@ +// 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 Lesser 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 System.ComponentModel; +using System.Windows.Forms; +using Core.Gui.PropertyBag; +using NUnit.Framework; + +namespace Core.Gui.TestUtil +{ + /// + /// Helper class for dealing with implementations and + /// other objects that are meant to be shown in the . + /// + public static class PropertiesTestHelper + { + /// + /// Gets all visible property descriptors for a given 'object properties' object. + /// + /// The properties object. + /// All visible property descriptors. + public static PropertyDescriptorCollection GetAllVisiblePropertyDescriptors(object propertiesObject) + { + var dynamicPropertyBag = new DynamicPropertyBag(propertiesObject); + return dynamicPropertyBag.GetProperties(new Attribute[] + { + BrowsableAttribute.Yes + }); + } + + /// + /// Asserts the properties of a on required subjects. + /// + /// The property to be checked. + /// The expected category. + /// The expected name of the property shown to the user. + /// The expected description of the property shown to the user. + /// Indicates whether or not the property is read-only. + public static void AssertRequiredPropertyDescriptorProperties(PropertyDescriptor property, + string expectedCategory, + string expectedDisplayName, + string expectedDescription, + bool isReadOnly = false) + { + Assert.AreEqual(isReadOnly, property.IsReadOnly); + Assert.AreEqual(expectedCategory, property.Category); + Assert.AreEqual(expectedDisplayName, property.DisplayName); + Assert.AreEqual(expectedDescription, property.Description); + } + } +} \ No newline at end of file Index: Core/Gui/test/Core.Gui.TestUtil/TestPlugin.cs =================================================================== diff -u --- Core/Gui/test/Core.Gui.TestUtil/TestPlugin.cs (revision 0) +++ Core/Gui/test/Core.Gui.TestUtil/TestPlugin.cs (revision 4657c1cd3629ca7330a5e9da02bcec60127509f3) @@ -0,0 +1,39 @@ +// 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 Lesser 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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.Collections.Generic; +using Core.Common.Base.Data; +using Core.Common.Controls.TreeView; +using Core.Gui.Plugin; + +namespace Core.Gui.TestUtil +{ + /// + /// Simple plugin that can be used in tests. + /// + public class TestPlugin : PluginBase + { + public override IEnumerable GetTreeNodeInfos() + { + yield return new TreeNodeInfo(); + } + } +} \ No newline at end of file