Index: Core/Common/test/Core.Common.Base.Test/Core.Common.Base.Test.csproj
===================================================================
diff -u -r13f47cf031a0cb759b4685bcdcde112f039d00d3 -rd6e6eadf4a2521df75b6d371bacbb181a43058a3
--- Core/Common/test/Core.Common.Base.Test/Core.Common.Base.Test.csproj (.../Core.Common.Base.Test.csproj) (revision 13f47cf031a0cb759b4685bcdcde112f039d00d3)
+++ Core/Common/test/Core.Common.Base.Test/Core.Common.Base.Test.csproj (.../Core.Common.Base.Test.csproj) (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -95,9 +95,9 @@
{F49BD8B2-332A-4C91-A196-8CCE0A2C7D98}
Core.Common.Utils
-
+
{D749EE4C-CE50-4C17-BF01-9A953028C126}
- Core.Common.TestUtils
+ Core.Common.TestUtil
Index: Core/Common/test/Core.Common.Base.Test/Service/ActivityTest.cs
===================================================================
diff -u -r5914abad7fec8a4bf5634acaf15571b7c195f677 -rd6e6eadf4a2521df75b6d371bacbb181a43058a3
--- Core/Common/test/Core.Common.Base.Test/Service/ActivityTest.cs (.../ActivityTest.cs) (revision 5914abad7fec8a4bf5634acaf15571b7c195f677)
+++ Core/Common/test/Core.Common.Base.Test/Service/ActivityTest.cs (.../ActivityTest.cs) (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -1,6 +1,6 @@
using System;
using Core.Common.Base.Service;
-using Core.Common.TestUtils;
+using Core.Common.TestUtil;
using NUnit.Framework;
namespace Core.Common.Base.Test.Service
Index: Core/Common/test/Core.Common.Controls.Swf.Test/Charting/ChartTest.cs
===================================================================
diff -u -rdc06f24147cb5d1f94cec6f3705d07dc3142d175 -rd6e6eadf4a2521df75b6d371bacbb181a43058a3
--- Core/Common/test/Core.Common.Controls.Swf.Test/Charting/ChartTest.cs (.../ChartTest.cs) (revision dc06f24147cb5d1f94cec6f3705d07dc3142d175)
+++ Core/Common/test/Core.Common.Controls.Swf.Test/Charting/ChartTest.cs (.../ChartTest.cs) (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -2,7 +2,7 @@
using System.IO;
using Core.Common.Controls.Swf.Charting;
using Core.Common.Controls.Swf.Charting.Series;
-using Core.Common.TestUtils;
+using Core.Common.TestUtil;
using NUnit.Framework;
namespace Core.Common.Controls.Swf.Test.Charting
Index: Core/Common/test/Core.Common.Controls.Swf.Test/Core.Common.Controls.Swf.Test.csproj
===================================================================
diff -u -r3966c8176854557199325b0465f0c6a1c9225f38 -rd6e6eadf4a2521df75b6d371bacbb181a43058a3
--- Core/Common/test/Core.Common.Controls.Swf.Test/Core.Common.Controls.Swf.Test.csproj (.../Core.Common.Controls.Swf.Test.csproj) (revision 3966c8176854557199325b0465f0c6a1c9225f38)
+++ Core/Common/test/Core.Common.Controls.Swf.Test/Core.Common.Controls.Swf.Test.csproj (.../Core.Common.Controls.Swf.Test.csproj) (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -116,9 +116,9 @@
{f49bd8b2-332a-4c91-a196-8cce0a2c7d98}
Core.Common.Utils
-
+
{D749EE4C-CE50-4C17-BF01-9A953028C126}
- Core.Common.TestUtils
+ Core.Common.TestUtil
Index: Core/Common/test/Core.Common.Controls.Swf.Test/Table/TableViewCopyPasteTest.cs
===================================================================
diff -u -rdc06f24147cb5d1f94cec6f3705d07dc3142d175 -rd6e6eadf4a2521df75b6d371bacbb181a43058a3
--- Core/Common/test/Core.Common.Controls.Swf.Test/Table/TableViewCopyPasteTest.cs (.../TableViewCopyPasteTest.cs) (revision dc06f24147cb5d1f94cec6f3705d07dc3142d175)
+++ Core/Common/test/Core.Common.Controls.Swf.Test/Table/TableViewCopyPasteTest.cs (.../TableViewCopyPasteTest.cs) (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -6,7 +6,7 @@
using System.Windows.Forms;
using Core.Common.Controls.Swf.Table;
using Core.Common.Controls.Swf.Test.Table.TestClasses;
-using Core.Common.TestUtils;
+using Core.Common.TestUtil;
using Core.Common.Utils;
using DevExpress.XtraGrid;
using NUnit.Framework;
Index: Core/Common/test/Core.Common.Controls.Swf.Test/Table/TableViewTest.cs
===================================================================
diff -u -r23981d00366f6ee42b7b3c2b776a687c1dc70d07 -rd6e6eadf4a2521df75b6d371bacbb181a43058a3
--- Core/Common/test/Core.Common.Controls.Swf.Test/Table/TableViewTest.cs (.../TableViewTest.cs) (revision 23981d00366f6ee42b7b3c2b776a687c1dc70d07)
+++ Core/Common/test/Core.Common.Controls.Swf.Test/Table/TableViewTest.cs (.../TableViewTest.cs) (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -11,7 +11,7 @@
using Core.Common.Controls.Swf.Table;
using Core.Common.Controls.Swf.Table.Editors;
using Core.Common.Controls.Swf.Test.Table.TestClasses;
-using Core.Common.TestUtils;
+using Core.Common.TestUtil;
using Core.Common.Utils.Collections.Generic;
using Core.Common.Utils.Reflection;
using DevExpress.XtraEditors.Repository;
Index: Core/Common/test/Core.Common.Controls.Swf.Test/TreeViewControls/TreeViewNodePresenterBaseTest.cs
===================================================================
diff -u -rdc06f24147cb5d1f94cec6f3705d07dc3142d175 -rd6e6eadf4a2521df75b6d371bacbb181a43058a3
--- Core/Common/test/Core.Common.Controls.Swf.Test/TreeViewControls/TreeViewNodePresenterBaseTest.cs (.../TreeViewNodePresenterBaseTest.cs) (revision dc06f24147cb5d1f94cec6f3705d07dc3142d175)
+++ Core/Common/test/Core.Common.Controls.Swf.Test/TreeViewControls/TreeViewNodePresenterBaseTest.cs (.../TreeViewNodePresenterBaseTest.cs) (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -3,7 +3,7 @@
using System.Linq;
using Core.Common.Base;
using Core.Common.Controls.Swf.TreeViewControls;
-using Core.Common.TestUtils;
+using Core.Common.TestUtil;
using NUnit.Framework;
namespace Core.Common.Controls.Swf.Test.TreeViewControls
Index: Core/Common/test/Core.Common.Controls.Swf.Test/TreeViewControls/TreeViewTest.cs
===================================================================
diff -u -r2e855cfd58cca717db843b13e1e24f1fc9c4f451 -rd6e6eadf4a2521df75b6d371bacbb181a43058a3
--- Core/Common/test/Core.Common.Controls.Swf.Test/TreeViewControls/TreeViewTest.cs (.../TreeViewTest.cs) (revision 2e855cfd58cca717db843b13e1e24f1fc9c4f451)
+++ Core/Common/test/Core.Common.Controls.Swf.Test/TreeViewControls/TreeViewTest.cs (.../TreeViewTest.cs) (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -7,7 +7,7 @@
using System.Windows.Forms;
using Core.Common.Base;
using Core.Common.Controls.Swf.TreeViewControls;
-using Core.Common.TestUtils;
+using Core.Common.TestUtil;
using Core.Common.Utils.Collections.Generic;
using NUnit.Extensions.Forms;
using NUnit.Framework;
Index: Core/Common/test/Core.Common.Gui.Test/ContextMenu/ContextMenuBuilderTest.cs
===================================================================
diff -u -r6fc99be8198e5795ca4be54719dab3d1be3c6299 -rd6e6eadf4a2521df75b6d371bacbb181a43058a3
--- Core/Common/test/Core.Common.Gui.Test/ContextMenu/ContextMenuBuilderTest.cs (.../ContextMenuBuilderTest.cs) (revision 6fc99be8198e5795ca4be54719dab3d1be3c6299)
+++ Core/Common/test/Core.Common.Gui.Test/ContextMenu/ContextMenuBuilderTest.cs (.../ContextMenuBuilderTest.cs) (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -4,7 +4,7 @@
using Core.Common.Controls.Swf.TreeViewControls;
using Core.Common.Gui.ContextMenu;
using Core.Common.Gui.Properties;
-using Core.Common.TestUtils;
+using Core.Common.TestUtil;
using NUnit.Framework;
using Rhino.Mocks;
Index: Core/Common/test/Core.Common.Gui.Test/ContextMenu/GuiContextMenuItemFactoryTest.cs
===================================================================
diff -u -r6fc99be8198e5795ca4be54719dab3d1be3c6299 -rd6e6eadf4a2521df75b6d371bacbb181a43058a3
--- Core/Common/test/Core.Common.Gui.Test/ContextMenu/GuiContextMenuItemFactoryTest.cs (.../GuiContextMenuItemFactoryTest.cs) (revision 6fc99be8198e5795ca4be54719dab3d1be3c6299)
+++ Core/Common/test/Core.Common.Gui.Test/ContextMenu/GuiContextMenuItemFactoryTest.cs (.../GuiContextMenuItemFactoryTest.cs) (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -3,7 +3,7 @@
using Core.Common.Controls.Swf.TreeViewControls;
using Core.Common.Gui.ContextMenu;
using Core.Common.Gui.Properties;
-using Core.Common.TestUtils;
+using Core.Common.TestUtil;
using NUnit.Framework;
using Rhino.Mocks;
Index: Core/Common/test/Core.Common.Gui.Test/ContextMenu/StrictContextMenuItemTest.cs
===================================================================
diff -u -r85af6861f16df8c5d57e3e39d0d2874e7bd16b8e -rd6e6eadf4a2521df75b6d371bacbb181a43058a3
--- Core/Common/test/Core.Common.Gui.Test/ContextMenu/StrictContextMenuItemTest.cs (.../StrictContextMenuItemTest.cs) (revision 85af6861f16df8c5d57e3e39d0d2874e7bd16b8e)
+++ Core/Common/test/Core.Common.Gui.Test/ContextMenu/StrictContextMenuItemTest.cs (.../StrictContextMenuItemTest.cs) (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -1,7 +1,7 @@
using System;
using Core.Common.Gui.ContextMenu;
using Core.Common.Gui.Properties;
-using Core.Common.TestUtils;
+using Core.Common.TestUtil;
using NUnit.Framework;
using Rhino.Mocks;
Index: Core/Common/test/Core.Common.Gui.Test/ContextMenu/TreeViewContextMenuItemFactoryTest.cs
===================================================================
diff -u -rebe6e048a6c4e9146e883e19e213f41df96aabf1 -rd6e6eadf4a2521df75b6d371bacbb181a43058a3
--- Core/Common/test/Core.Common.Gui.Test/ContextMenu/TreeViewContextMenuItemFactoryTest.cs (.../TreeViewContextMenuItemFactoryTest.cs) (revision ebe6e048a6c4e9146e883e19e213f41df96aabf1)
+++ Core/Common/test/Core.Common.Gui.Test/ContextMenu/TreeViewContextMenuItemFactoryTest.cs (.../TreeViewContextMenuItemFactoryTest.cs) (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -4,7 +4,7 @@
using Core.Common.Controls.Swf.TreeViewControls;
using Core.Common.Gui.ContextMenu;
using Core.Common.Gui.Properties;
-using Core.Common.TestUtils;
+using Core.Common.TestUtil;
using NUnit.Framework;
using Rhino.Mocks;
Index: Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj
===================================================================
diff -u -r00bf02e3c099d01fbdb84735d8fc64de0fb98aaa -rd6e6eadf4a2521df75b6d371bacbb181a43058a3
--- Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj (.../Core.Common.Gui.Test.csproj) (revision 00bf02e3c099d01fbdb84735d8fc64de0fb98aaa)
+++ Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj (.../Core.Common.Gui.Test.csproj) (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -83,13 +83,13 @@
{30e4c2ae-719e-4d70-9fa9-668a9767fbfa}
Core.Common.Gui
-
+
{26214BD0-DAFB-4CFC-8EB2-80C5D53C859E}
- Core.Common.Gui.TestUtils
+ Core.Common.Gui.TestUtil
-
+
{D749EE4C-CE50-4C17-BF01-9A953028C126}
- Core.Common.TestUtils
+ Core.Common.TestUtil
Index: Core/Common/test/Core.Common.Gui.TestUtil/ContextMenu/CustomItemsOnlyContextMenuBuilder.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.Gui.TestUtil/ContextMenu/CustomItemsOnlyContextMenuBuilder.cs (revision 0)
+++ Core/Common/test/Core.Common.Gui.TestUtil/ContextMenu/CustomItemsOnlyContextMenuBuilder.cs (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,109 @@
+using System.Windows.Forms;
+using Core.Common.Gui.ContextMenu;
+
+namespace Core.Common.Gui.TestUtil.ContextMenu
+{
+ ///
+ /// This class can be used for easily testing the custom items which are added to a context menu.
+ ///
+ public class CustomItemsOnlyContextMenuBuilder : IContextMenuBuilder
+ {
+ ///
+ /// The context menu which is build.
+ ///
+ private readonly ContextMenuStrip contextMenu = new ContextMenuStrip();
+
+ ///
+ /// Does nothing.
+ ///
+ /// The .
+ public IContextMenuBuilder AddDeleteItem()
+ {
+ return this;
+ }
+
+ ///
+ /// Does nothing.
+ ///
+ /// The .
+ public IContextMenuBuilder AddExpandAllItem()
+ {
+ return this;
+ }
+
+ ///
+ /// Does nothing.
+ ///
+ /// The .
+ public IContextMenuBuilder AddCollapseAllItem()
+ {
+ return this;
+ }
+
+ ///
+ /// Does nothing.
+ ///
+ /// The .
+ public IContextMenuBuilder AddOpenItem()
+ {
+ return this;
+ }
+
+ ///
+ /// Does nothing.
+ ///
+ /// The .
+ public IContextMenuBuilder AddExportItem()
+ {
+ return this;
+ }
+
+ ///
+ /// Does nothing.
+ ///
+ /// The .
+ public IContextMenuBuilder AddImportItem()
+ {
+ return this;
+ }
+
+ ///
+ /// Does nothing.
+ ///
+ /// The .
+ public IContextMenuBuilder AddPropertiesItem()
+ {
+ return this;
+ }
+
+ ///
+ /// Adds a toolstrip separator.
+ ///
+ /// The .
+ public IContextMenuBuilder AddSeparator()
+ {
+ contextMenu.Items.Add(new ToolStripSeparator());
+ return this;
+ }
+
+ ///
+ /// Adds a custom item to the .
+ ///
+ /// The custom to add to the .
+ /// The .
+ public IContextMenuBuilder AddCustomItem(StrictContextMenuItem item)
+ {
+ contextMenu.Items.Add(item);
+ return this;
+ }
+
+ ///
+ /// Obtain the , which has been constructed by using .
+ ///
+ /// The constructed .
+ public ContextMenuStrip Build()
+ {
+ return contextMenu;
+ }
+ }
+}
\ No newline at end of file
Index: Core/Common/test/Core.Common.Gui.TestUtil/ContextMenu/SimpleContextMenuBuilderProvider.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.Gui.TestUtil/ContextMenu/SimpleContextMenuBuilderProvider.cs (revision 0)
+++ Core/Common/test/Core.Common.Gui.TestUtil/ContextMenu/SimpleContextMenuBuilderProvider.cs (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,34 @@
+using System;
+using Core.Common.Controls.Swf.TreeViewControls;
+using Core.Common.Gui.ContextMenu;
+
+namespace Core.Common.Gui.TestUtil.ContextMenu
+{
+ ///
+ /// Proves a simple implementation of to be
+ /// used in tests.
+ ///
+ public class SimpleContextMenuBuilderProvider : IContextMenuBuilderProvider
+ {
+ private readonly IContextMenuBuilder contextMenuBuilder;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The context menu builder.
+ /// When is null.
+ public SimpleContextMenuBuilderProvider(IContextMenuBuilder contextMenuBuilder)
+ {
+ if (contextMenuBuilder == null)
+ {
+ throw new ArgumentNullException("contextMenuBuilder");
+ }
+ this.contextMenuBuilder = contextMenuBuilder;
+ }
+
+ public IContextMenuBuilder Get(ITreeNode treeNode)
+ {
+ return contextMenuBuilder;
+ }
+ }
+}
\ No newline at end of file
Index: Core/Common/test/Core.Common.Gui.TestUtil/Core.Common.Gui.TestUtil.csproj
===================================================================
diff -u
--- Core/Common/test/Core.Common.Gui.TestUtil/Core.Common.Gui.TestUtil.csproj (revision 0)
+++ Core/Common/test/Core.Common.Gui.TestUtil/Core.Common.Gui.TestUtil.csproj (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,123 @@
+
+
+
+ Debug
+ x86
+ 9.0.30729
+ 2.0
+ {26214BD0-DAFB-4CFC-8EB2-80C5D53C859E}
+ Library
+ Properties
+ Core.Common.Gui.TestUtil
+ Core.Common.Gui.TestUtil
+ v4.0
+ 512
+ Always
+
+
+ 3.5
+
+ false
+ false
+
+
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ true
+
+
+ true
+ bin\Debug\
+ 4
+ x86
+ MinimumRecommendedRules.ruleset
+ TRACE;DEBUG
+ full
+
+
+ none
+ bin\Release\
+ 4
+ x86
+ MinimumRecommendedRules.ruleset
+ TRACE
+ true
+
+
+ bin\ReleaseForCodeCoverage\
+ TRACE
+ true
+ x86
+ MinimumRecommendedRules.ruleset
+
+
+
+ False
+ .NET Framework 3.5 SP1 Client Profile
+ false
+
+
+ False
+ .NET Framework 3.5 SP1
+ true
+
+
+ False
+ Windows Installer 3.1
+ true
+
+
+
+
+
+
+
+
+
+ {3DBD23CE-5C4A-4A49-B51C-B268CB2B510E}
+ Core.Common.Controls.Swf
+
+
+ {30E4C2AE-719E-4D70-9FA9-668A9767FBFA}
+ Core.Common.Gui
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: Core/Common/test/Core.Common.Gui.TestUtil/Properties/AssemblyInfo.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.Gui.TestUtil/Properties/AssemblyInfo.cs (revision 0)
+++ Core/Common/test/Core.Common.Gui.TestUtil/Properties/AssemblyInfo.cs (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,13 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("Core.Common.Gui.TestUtil")]
+[assembly: AssemblyProduct("Core.Common.Gui.TestUtil")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("d749c2bb-9e8a-4211-b24b-d3b179e73042")]
\ No newline at end of file
Index: Core/Common/test/Core.Common.Gui.TestUtil/packages.config
===================================================================
diff -u
--- Core/Common/test/Core.Common.Gui.TestUtil/packages.config (revision 0)
+++ Core/Common/test/Core.Common.Gui.TestUtil/packages.config (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
Fisheye: Tag d6e6eadf4a2521df75b6d371bacbb181a43058a3 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.Gui.TestUtils/ContextMenu/CustomItemsOnlyContextMenuBuilder.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag d6e6eadf4a2521df75b6d371bacbb181a43058a3 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.Gui.TestUtils/ContextMenu/SimpleContextMenuBuilderProvider.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag d6e6eadf4a2521df75b6d371bacbb181a43058a3 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.Gui.TestUtils/Core.Common.Gui.TestUtils.csproj'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag d6e6eadf4a2521df75b6d371bacbb181a43058a3 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.Gui.TestUtils/Properties/AssemblyInfo.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag d6e6eadf4a2521df75b6d371bacbb181a43058a3 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.Gui.TestUtils/packages.config'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Core/Common/test/Core.Common.Integration.Test/Core.Common.Integration.Test.csproj
===================================================================
diff -u -r73c2e06a527fc4b0d2659c388a00a2f7dfff6ccf -rd6e6eadf4a2521df75b6d371bacbb181a43058a3
--- Core/Common/test/Core.Common.Integration.Test/Core.Common.Integration.Test.csproj (.../Core.Common.Integration.Test.csproj) (revision 73c2e06a527fc4b0d2659c388a00a2f7dfff6ccf)
+++ Core/Common/test/Core.Common.Integration.Test/Core.Common.Integration.Test.csproj (.../Core.Common.Integration.Test.csproj) (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -160,9 +160,9 @@
{F49BD8B2-332A-4C91-A196-8CCE0A2C7D98}
Core.Common.Utils
-
+
{D749EE4C-CE50-4C17-BF01-9A953028C126}
- Core.Common.TestUtils
+ Core.Common.TestUtil
Index: Core/Common/test/Core.Common.Integration.Test/Ringtoets/Application.Ringtoets/RingtoetsGuiIntegrationTest.cs
===================================================================
diff -u -r1f79b34c12554e2b9878f6296168d18232cc9852 -rd6e6eadf4a2521df75b6d371bacbb181a43058a3
--- Core/Common/test/Core.Common.Integration.Test/Ringtoets/Application.Ringtoets/RingtoetsGuiIntegrationTest.cs (.../RingtoetsGuiIntegrationTest.cs) (revision 1f79b34c12554e2b9878f6296168d18232cc9852)
+++ Core/Common/test/Core.Common.Integration.Test/Ringtoets/Application.Ringtoets/RingtoetsGuiIntegrationTest.cs (.../RingtoetsGuiIntegrationTest.cs) (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -3,7 +3,7 @@
using Core.Common.Base;
using Core.Common.Base.Data;
using Core.Common.Gui;
-using Core.Common.TestUtils;
+using Core.Common.TestUtil;
using Core.GIS.SharpMap.Map;
using Core.Plugins.CommonTools;
using Core.Plugins.CommonTools.Gui;
Index: Core/Common/test/Core.Common.TestUtil.Test/Core.Common.TestUtil.Test.csproj
===================================================================
diff -u
--- Core/Common/test/Core.Common.TestUtil.Test/Core.Common.TestUtil.Test.csproj (revision 0)
+++ Core/Common/test/Core.Common.TestUtil.Test/Core.Common.TestUtil.Test.csproj (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,69 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {FAF691DE-EAF5-44E0-A865-5A03FB395ED1}
+ Library
+ Properties
+ Core.Common.TestUtil.Test
+ Core.Common.TestUtil.Test
+ v4.0
+ 512
+
+
+
+ true
+ bin\Debug\
+ DEBUG;TRACE
+ full
+ x86
+ prompt
+ MinimumRecommendedRules.ruleset
+
+
+ bin\Release\
+ TRACE
+ true
+ pdbonly
+ x86
+ prompt
+ MinimumRecommendedRules.ruleset
+
+
+ bin\ReleaseForCodeCoverage\
+ x86
+ TRACE
+ true
+
+
+
+ ..\..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {D749EE4C-CE50-4C17-BF01-9A953028C126}
+ Core.Common.TestUtil
+
+
+
+
+
\ No newline at end of file
Index: Core/Common/test/Core.Common.TestUtil.Test/Properties/AssemblyInfo.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.TestUtil.Test/Properties/AssemblyInfo.cs (revision 0)
+++ Core/Common/test/Core.Common.TestUtil.Test/Properties/AssemblyInfo.cs (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Core.Common.TestUtil.Test")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("Core.Common.TestUtil.Test")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("beab02d9-ffbf-4ccd-8010-44d4b2d2d4b7")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Index: Core/Common/test/Core.Common.TestUtil.Test/WindowsFormsTestHelperTest.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.TestUtil.Test/WindowsFormsTestHelperTest.cs (revision 0)
+++ Core/Common/test/Core.Common.TestUtil.Test/WindowsFormsTestHelperTest.cs (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,135 @@
+using System;
+using System.Threading;
+using System.Windows.Forms;
+using NUnit.Framework;
+
+namespace Core.Common.TestUtil.Test
+{
+ [TestFixture]
+ public class WindowsFormsTestHelperTest
+ {
+ [Test]
+ public void ShowActionIsRunForAFormUsingShow()
+ {
+ var form = new Form();
+ int callCount = 0;
+
+ WindowsFormsTestHelper.Show(form, delegate { callCount++; });
+
+ Assert.AreEqual(1, callCount);
+
+ WindowsFormsTestHelper.CloseAll();
+ }
+
+ [Test]
+ public void ShowActionIsRunForUserControl()
+ {
+ var uc = new UserControl();
+ int callCount = 0;
+
+ WindowsFormsTestHelper.Show(uc, delegate { callCount++; });
+
+ Assert.AreEqual(1, callCount);
+
+ WindowsFormsTestHelper.CloseAll();
+ }
+
+ [Test]
+ public void ShowActionIsRunForForm()
+ {
+ var form = new Form();
+ int callCount = 0;
+
+ WindowsFormsTestHelper.Show(form, delegate { callCount++; });
+
+ Assert.AreEqual(1, callCount);
+
+ WindowsFormsTestHelper.CloseAll();
+ }
+
+ [Test]
+ public void ExceptionsInActionLogsStackTraceCorrectlyCorrectly()
+ {
+ try
+ {
+ WindowsFormsTestHelper.Show(new Label(), MethodWithException);
+ }
+ catch (Exception e)
+ {
+ Assert.AreEqual(typeof(InvalidOperationException), e.GetType());
+ Assert.AreEqual("my message", e.Message);
+ Assert.IsTrue(e.StackTrace.Contains("MethodWithException"));
+ }
+
+ WindowsFormsTestHelper.CloseAll();
+ }
+
+ [Test]
+ public void UnhandledThreadExceptionsInActionLogsStackTraceCorrectlyCorrectly()
+ {
+ var thread = new Thread(MethodWithExceptionInSeparateThread);
+
+ try
+ {
+ WindowsFormsTestHelper.Show(new Label(),
+ delegate
+ {
+ thread.Start();
+ thread.Join();
+ });
+ }
+ catch (Exception e)
+ {
+ Assert.AreEqual(typeof(GuiTestHelper.UnhandledException), e.GetType());
+ Assert.IsTrue(e.Message.Contains("my message from thread"));
+ Assert.IsTrue(e.StackTrace.Contains("MethodWithExceptionInSeparateThread"));
+ }
+
+ WindowsFormsTestHelper.CloseAll();
+ }
+
+ [Test]
+ public void CallActionOnShowModal()
+ {
+ var callCount = 0;
+
+ WindowsFormsTestHelper.ShowModal(new Form(), delegate { callCount++; });
+
+ Assert.AreEqual(1, callCount);
+ }
+
+ [Test]
+ public void ShownCalledOnShowModal()
+ {
+ var callCount = 0;
+ var form = new Form();
+
+ form.Shown += delegate { callCount++; };
+
+ WindowsFormsTestHelper.ShowModal(form);
+
+ Assert.AreEqual(1, callCount);
+ }
+
+ [Test]
+ [ExpectedException(typeof(GuiTestHelper.UnhandledException))]
+ public void ExceptionIsCatchedWhenFromShownEvent()
+ {
+ var form = new Form();
+
+ form.Shown += delegate { Assert.Fail(); };
+
+ WindowsFormsTestHelper.ShowModal(form);
+ }
+
+ private void MethodWithException(Form obj)
+ {
+ throw new InvalidOperationException("my message");
+ }
+
+ private void MethodWithExceptionInSeparateThread()
+ {
+ throw new InvalidOperationException("my message from thread");
+ }
+ }
+}
\ No newline at end of file
Index: Core/Common/test/Core.Common.TestUtil.Test/packages.config
===================================================================
diff -u
--- Core/Common/test/Core.Common.TestUtil.Test/packages.config (revision 0)
+++ Core/Common/test/Core.Common.TestUtil.Test/packages.config (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
Index: Core/Common/test/Core.Common.TestUtil/Core.Common.TestUtil.csproj
===================================================================
diff -u
--- Core/Common/test/Core.Common.TestUtil/Core.Common.TestUtil.csproj (revision 0)
+++ Core/Common/test/Core.Common.TestUtil/Core.Common.TestUtil.csproj (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,179 @@
+
+
+
+ Debug
+ x86
+ 9.0.30729
+ 2.0
+ {D749EE4C-CE50-4C17-BF01-9A953028C126}
+ Library
+ Properties
+ Core.Common.TestUtil
+ Core.Common.TestUtil
+ v4.0
+ 512
+ Always
+
+
+ 3.5
+
+ false
+ false
+
+
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ true
+
+
+ true
+ bin\Debug\
+ 4
+ x86
+ MinimumRecommendedRules.ruleset
+ TRACE;DEBUG
+ full
+
+
+ none
+ bin\Release\
+ 4
+ x86
+ MinimumRecommendedRules.ruleset
+ TRACE
+ true
+
+
+ bin\ReleaseForCodeCoverage\
+ TRACE
+ true
+ x86
+ MinimumRecommendedRules.ruleset
+
+
+
+ ..\..\..\..\packages\log4net.2.0.4\lib\net40-full\log4net.dll
+ True
+
+
+ ..\..\..\..\packages\Newtonsoft.Json.7.0.1\lib\net40\Newtonsoft.Json.dll
+ True
+
+
+ ..\..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll
+ True
+
+
+
+
+
+ 3.5
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+ True
+ Resources.resx
+
+
+
+
+ Form
+
+
+ WindowsFormsTestHelper.cs
+
+
+ WpfTestHelper.xaml
+
+
+
+
+ {f49bd8b2-332a-4c91-a196-8cce0a2c7d98}
+ Core.Common.Utils
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ WindowsFormsTestHelper.cs
+ Designer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+ .NET Framework 3.5 SP1 Client Profile
+ false
+
+
+ False
+ .NET Framework 3.5 SP1
+ true
+
+
+ False
+ Windows Installer 3.1
+ true
+
+
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: Core/Common/test/Core.Common.TestUtil/GuiTestHelper.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.TestUtil/GuiTestHelper.cs (revision 0)
+++ Core/Common/test/Core.Common.TestUtil/GuiTestHelper.cs (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,162 @@
+using System;
+using System.Drawing;
+using System.IO;
+using System.Threading;
+using System.Windows.Forms;
+using System.Windows.Threading;
+using log4net;
+
+namespace Core.Common.TestUtil
+{
+ ///
+ /// Used by WindowsFormsTestHelper and WpfTestHelper
+ ///
+ /// TODO: invert it - use GuiTestHelper as entry point in tests.
+ ///
+ public class GuiTestHelper
+ {
+ private static GuiTestHelper instance;
+
+ private static readonly ILog log = LogManager.GetLogger(typeof(WindowsFormsTestHelper));
+
+ private static Form synchronizationForm;
+
+ private static Exception exception;
+
+ private static bool unhandledThreadExceptionOccured;
+
+ private static bool appDomainExceptionOccured;
+
+ static GuiTestHelper()
+ {
+ Control.CheckForIllegalCrossThreadCalls = true;
+ Application.EnableVisualStyles();
+
+ InitializeSynchronizatonObject();
+ Dispatcher.CurrentDispatcher.UnhandledException += CurrentDispatcher_UnhandledException;
+ AppDomain.CurrentDomain.UnhandledException += AppDomain_UnhandledException;
+ Application.ThreadException += Application_ThreadException;
+ }
+
+ public static GuiTestHelper Instance
+ {
+ get
+ {
+ if (instance == null)
+ {
+ instance = new GuiTestHelper();
+ }
+
+ return instance;
+ }
+ }
+
+ ///
+ /// Checks build_number environment variable to determine whether we run on the build server.
+ ///
+ public static bool IsBuildServer
+ {
+ get
+ {
+ return File.Exists("C:\\build.server")
+ || File.Exists("D:\\build.server")
+ || File.Exists("/tmp/build-server")
+ || !String.IsNullOrEmpty(Environment.GetEnvironmentVariable("BUILD_NUMBER"));
+ }
+ }
+
+ public Exception Exception
+ {
+ get
+ {
+ return exception;
+ }
+ }
+
+ public void RethrowUnhandledException()
+ {
+ if (unhandledThreadExceptionOccured)
+ {
+ throw new UnhandledException("Unhandled thread exception: " + exception.Message, exception, exception.StackTrace);
+ }
+
+ if (appDomainExceptionOccured)
+ {
+ throw new UnhandledException("Unhandled app domain exception: " + exception.Message, exception, exception.StackTrace);
+ }
+ }
+
+ public static void Initialize()
+ {
+ exception = null;
+ unhandledThreadExceptionOccured = false;
+ appDomainExceptionOccured = false;
+ }
+
+ private static void CurrentDispatcher_UnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
+ {
+ unhandledThreadExceptionOccured = true;
+ exception = e.Exception;
+ log.Error("WPF exception occured: " + e.Exception.Message, e.Exception);
+ }
+
+ private static void InitializeSynchronizatonObject()
+ {
+
+ if (synchronizationForm == null)
+ {
+ synchronizationForm = new Form
+ {
+ ShowInTaskbar = false, WindowState = FormWindowState.Minimized, FormBorderStyle = FormBorderStyle.None
+ };
+ synchronizationForm.Load += (sender, args) => synchronizationForm.Size = new Size(0, 0);
+ var handle = synchronizationForm.Handle; //force get handle
+ synchronizationForm.Show();
+ }
+ }
+
+ private static void AppDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
+ {
+ appDomainExceptionOccured = true;
+ exception = e.ExceptionObject as Exception;
+
+ if (exception != null)
+ {
+ log.Error("Exception occured: " + exception.Message, exception);
+ }
+ else
+ {
+ log.Error("Unhandled exception occured: " + e.ExceptionObject);
+ }
+ }
+
+ private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
+ {
+ unhandledThreadExceptionOccured = true;
+ exception = e.Exception;
+ log.Error("Windows.Forms exception occured: " + e.Exception.Message, e.Exception);
+ }
+
+ ///
+ /// Defines unhandled exception which provides stack trace of inner exception as its stack trace.
+ ///
+ public class UnhandledException : Exception
+ {
+ private readonly string stackTrace;
+
+ public UnhandledException(string message, Exception innerException, string stackTrace)
+ : base(message, innerException)
+ {
+ this.stackTrace = stackTrace;
+ }
+
+ public override string StackTrace
+ {
+ get
+ {
+ return stackTrace;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
Index: Core/Common/test/Core.Common.TestUtil/LogHelper.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.TestUtil/LogHelper.cs (revision 0)
+++ Core/Common/test/Core.Common.TestUtil/LogHelper.cs (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,56 @@
+using log4net;
+using log4net.Config;
+using log4net.Core;
+using log4net.Repository.Hierarchy;
+
+namespace Core.Common.TestUtil
+{
+ public static class LogHelper
+ {
+ ///
+ /// Sets logging level for all current loggers to the level provided in arguments.
+ /// Note: use it only when you need more control on logging, e.g. in unit tests. Otherwise use configuration files.
+ ///
+ ///
+ public static void SetLoggingLevel(Level level)
+ {
+ var repositories = LogManager.GetAllRepositories();
+
+ //Configure all loggers to be at the debug level.
+ foreach (var repository in repositories)
+ {
+ repository.Threshold = repository.LevelMap[level.ToString()];
+ var hierarchy = (Hierarchy) repository;
+ var loggers = hierarchy.GetCurrentLoggers();
+ foreach (var logger in loggers)
+ {
+ ((Logger) logger).Level = hierarchy.LevelMap[level.ToString()];
+ }
+ }
+
+ //Configure the root logger.
+ var h = (Hierarchy) LogManager.GetRepository();
+ var rootLogger = h.Root;
+ rootLogger.Level = h.LevelMap[level.ToString()];
+ }
+
+ ///
+ /// Configures logging. In case of log4net reads log4net section from app.config file.
+ ///
+ public static void ConfigureLogging(Level level = null)
+ {
+ ResetLogging();
+ BasicConfigurator.Configure();
+ SetLoggingLevel(level ?? Level.Error);
+ }
+
+ ///
+ /// Resets logging configuration, no log messages are sent after that.
+ ///
+ public static void ResetLogging()
+ {
+ LogManager.ResetConfiguration();
+ SetLoggingLevel(Level.Error);
+ }
+ }
+}
\ No newline at end of file
Index: Core/Common/test/Core.Common.TestUtil/Properties/AssemblyInfo.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.TestUtil/Properties/AssemblyInfo.cs (revision 0)
+++ Core/Common/test/Core.Common.TestUtil/Properties/AssemblyInfo.cs (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,13 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("Core.Common.TestUtil")]
+[assembly: AssemblyProduct("Core.Common.TestUtil")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("d749c2bb-9e8a-4211-b24b-d3b179e73042")]
\ No newline at end of file
Index: Core/Common/test/Core.Common.TestUtil/Resources.Designer.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.TestUtil/Resources.Designer.cs (revision 0)
+++ Core/Common/test/Core.Common.TestUtil/Resources.Designer.cs (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,93 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Core.Common.TestUtil {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Core.Common.TestUtil.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Control {
+ get {
+ object obj = ResourceManager.GetObject("Control", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Data {
+ get {
+ object obj = ResourceManager.GetObject("Data", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Table {
+ get {
+ object obj = ResourceManager.GetObject("Table", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+ }
+}
Index: Core/Common/test/Core.Common.TestUtil/Resources.resx
===================================================================
diff -u
--- Core/Common/test/Core.Common.TestUtil/Resources.resx (revision 0)
+++ Core/Common/test/Core.Common.TestUtil/Resources.resx (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ Resources\application_form.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ Resources\database.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ Resources\table.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
\ No newline at end of file
Index: Core/Common/test/Core.Common.TestUtil/Resources/application_form.png
===================================================================
diff -u
Binary files differ
Index: Core/Common/test/Core.Common.TestUtil/Resources/database.png
===================================================================
diff -u
Binary files differ
Index: Core/Common/test/Core.Common.TestUtil/Resources/table.png
===================================================================
diff -u
Binary files differ
Index: Core/Common/test/Core.Common.TestUtil/TestDataPath.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.TestUtil/TestDataPath.cs (revision 0)
+++ Core/Common/test/Core.Common.TestUtil/TestDataPath.cs (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,40 @@
+namespace Core.Common.TestUtil
+{
+ ///
+ /// Used to make paths strongly typed, see
+ ///
+ public class TestDataPath
+ {
+ public string Path { get; private set; }
+
+ public static implicit operator TestDataPath(string path)
+ {
+ return new TestDataPath
+ {
+ Path = path
+ };
+ }
+
+ public static class Common
+ {
+ public static readonly TestDataPath CoreCommonUtilsTests =
+ System.IO.Path.Combine("Core", "Common", "test", "Core.Common.Utils.Test");
+
+ public static class Base
+ {
+ public static readonly TestDataPath CoreCommonBaseTests = @"Core/Common/test/Core.Common.Base.Test";
+ }
+ }
+
+ public static class Ringtoets
+ {
+ public static class Piping
+ {
+ public static readonly TestDataPath IO = System.IO.Path.Combine("Ringtoets", "Piping", "test", "Ringtoets.Piping.IO.Test");
+ }
+
+ public static readonly TestDataPath CorePluginsSharpMapGisTests =
+ @"Core/Plugins/test/Core.Plugins.SharpMapGis.Test/";
+ }
+ }
+}
\ No newline at end of file
Index: Core/Common/test/Core.Common.TestUtil/TestHelper.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.TestUtil/TestHelper.cs (revision 0)
+++ Core/Common/test/Core.Common.TestUtil/TestHelper.cs (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,642 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Windows.Forms;
+using Core.Common.Utils.IO;
+using log4net.Appender;
+using log4net.Config;
+using log4net.Core;
+using Newtonsoft.Json;
+using NUnit.Framework;
+
+namespace Core.Common.TestUtil
+{
+ public class TestHelper
+ {
+ private static string solutionRoot;
+ private static int assertInTestMethod;
+ private static string lastTestName;
+ private static Color[] colors;
+
+ public static string SolutionRoot
+ {
+ get
+ {
+ if (solutionRoot == null)
+ {
+ solutionRoot = GetSolutionRoot();
+ }
+ return solutionRoot;
+ }
+ }
+
+ //TODO: Replace this property
+ public static string TestDataDirectory
+ {
+ get
+ {
+ return Path.GetDirectoryName(SolutionRoot);
+ }
+ }
+
+ public static string GetCurrentMethodName()
+ {
+ MethodBase callingMethod = new StackFrame(1, false).GetMethod();
+ return callingMethod.DeclaringType.Name + "." + callingMethod.Name;
+ }
+
+ ///
+ /// Returns full path to the file or directory in "test-data"
+ ///
+ ///
+ ///
+ public static string GetTestDataPath(TestDataPath path)
+ {
+ return Path.Combine(TestDataDirectory, path.Path);
+ }
+
+ ///
+ /// Returns full path to the file or directory in "test-data"
+ ///
+ ///
+ ///
+ ///
+ public static string GetTestDataPath(TestDataPath testDataPath, string path)
+ {
+ return Path.Combine(Path.Combine(TestDataDirectory, testDataPath.Path),"test-data", path);
+ }
+
+ public static string GetTestProjectDirectory()
+ {
+ var stackFrames = new StackTrace().GetFrames();
+ if (stackFrames == null)
+ {
+ throw new Exception("Could not get stacktrace.");
+ }
+
+ var testMethod = stackFrames.FirstOrDefault(f => f.GetMethod().GetCustomAttributes(typeof(TestAttribute), true).Any() ||
+ f.GetMethod().GetCustomAttributes(typeof(SetUpAttribute), true).Any() ||
+ f.GetMethod().GetCustomAttributes(typeof(TestFixtureSetUpAttribute), true).Any());
+
+ if (testMethod == null)
+ {
+ throw new Exception("Could not determine the test method.");
+ }
+
+ var testClassType = testMethod.GetMethod().DeclaringType;
+ if (testClassType == null)
+ {
+ throw new Exception("Could not find test class type.");
+ }
+
+ return Path.GetDirectoryName((new Uri(testClassType.Assembly.CodeBase)).AbsolutePath);
+ }
+
+ ///
+ /// Gets the test-data directory for the current test project.
+ ///
+ public static string GetDataDir()
+ {
+ var testProjectDirectory = GetTestProjectDirectory();
+ var rootedTestProjectFolderPath = Path.GetFullPath(Path.Combine(testProjectDirectory, "..", ".."));
+
+ return Path.GetFullPath(Path.Combine(rootedTestProjectFolderPath, "test-data") + Path.DirectorySeparatorChar);
+ }
+
+ ///
+ /// Get's the path in test-data tree section
+ ///
+ ///
+ ///
+ public static string GetTestFilePath(string filename)
+ {
+ var path = Path.Combine(GetDataDir(), filename);
+ var uri = new UriBuilder(path);
+
+ path = Uri.UnescapeDataString(uri.Path);
+ if (File.Exists(path))
+ {
+ return path;
+ }
+
+ // file not found..exception
+ throw new FileNotFoundException(String.Format("File not found: {0}", path), path);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Take HDD speed into account, makes sure that test timing is divided by MACHINE_HDD_PERFORMANCE_RANK environmental variable.
+ ///
+ public static double AssertIsFasterThan(float maxMilliseconds, Action action, bool rankHddAccess = false)
+ {
+ return AssertIsFasterThan(maxMilliseconds, null, action, rankHddAccess);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Take HDD speed into account, makes sure that test timing is divided by MACHINE_HDD_PERFORMANCE_RANK environmental variable.
+ ///
+ public static double AssertIsFasterThan(float maxMilliseconds, string message, Action action, bool rankHddAccess)
+ {
+ var stopwatch = new Stopwatch();
+ double actualMillisecond = default(double);
+
+ stopwatch.Start();
+ action();
+ stopwatch.Stop();
+
+ actualMillisecond = Math.Abs(actualMillisecond - default(double)) > 1e-5
+ ? Math.Min(stopwatch.ElapsedMilliseconds, actualMillisecond)
+ : stopwatch.ElapsedMilliseconds;
+
+ stopwatch.Reset();
+
+ string testName = GetCurrentTestClassMethodName();
+
+ if (testName == lastTestName) // check if there are more than one assert in a single test
+ {
+ assertInTestMethod++;
+ testName += assertInTestMethod;
+ }
+ else
+ {
+ lastTestName = testName;
+ assertInTestMethod = 1; // reset
+ }
+
+ float machinePerformanceRank = GetMachinePerformanceRank();
+
+ float machineHddPerformanceRank = GetMachineHddPerformanceRank();
+
+ var reportDirectory = GetSolutionRoot() + Path.DirectorySeparatorChar + "target/";
+ FileUtils.CreateDirectoryIfNotExists(reportDirectory);
+
+ var path = reportDirectory + "performance-times.html";
+ WriteTimesToLogFile(maxMilliseconds, (int) actualMillisecond, machinePerformanceRank,
+ machineHddPerformanceRank, rankHddAccess, testName, false, path);
+
+ path = reportDirectory + "performance-times-charts.html";
+ WriteTimesToLogFile(maxMilliseconds, (int) actualMillisecond, machinePerformanceRank,
+ machineHddPerformanceRank, rankHddAccess, testName, true, path);
+
+ float rank = machineHddPerformanceRank;
+
+ if (rankHddAccess) // when test relies a lot on HDD - multiply rank by hdd speed factor
+ {
+ rank *= machineHddPerformanceRank;
+ }
+
+ var userMessage = String.IsNullOrEmpty(message) ? "" : message + ". ";
+ if (rank != 1.0f)
+ {
+ Assert.IsTrue(rank*actualMillisecond < maxMilliseconds, userMessage + "Maximum of {0} milliseconds exceeded. Actual was {1}, machine performance weighted actual was {2}",
+ maxMilliseconds, actualMillisecond, actualMillisecond*rank);
+ Console.WriteLine(userMessage + String.Format("Test took {1} milliseconds (machine performance weighted {2}). Maximum was {0}",
+ maxMilliseconds, actualMillisecond, actualMillisecond*rank));
+ }
+ else
+ {
+ Assert.IsTrue(actualMillisecond < maxMilliseconds, userMessage + "Maximum of {0} milliseconds exceeded. Actual was {1}", maxMilliseconds,
+ actualMillisecond);
+ Console.WriteLine(userMessage + String.Format("Test took {1} milliseconds. Maximum was {0}", maxMilliseconds, actualMillisecond));
+ }
+
+ return actualMillisecond;
+ }
+
+ ///
+ /// Checks if the given messages occurs in the log.
+ ///
+ /// Action to be performed while recording the log
+ /// The message that should occur in the log
+ /// Optional: assert that log has this number of messages.
+ public static void AssertLogMessageIsGenerated(Action action, string message, int? expectedLogMessageCount = null)
+ {
+ AssertLogMessagesAreGenerated(action, new[]
+ {
+ message
+ }, expectedLogMessageCount);
+ }
+
+ ///
+ /// Method used to check if a collection of messages have occured in the log.
+ /// This function allowed checking log messages being generated like
+ /// without having to rerun the action for every single message. Fails the test when any of checks fail.
+ ///
+ /// Action to be performed while recording the log
+ /// The collection of messages that should occur in the log
+ /// Optional: assert that log has this number of messages.
+ ///
+ public static void AssertLogMessagesAreGenerated(Action action, IEnumerable messages, int? expectedLogMessageCount = null)
+ {
+ var renderedMessages = GetAllRenderedMessages(action);
+
+ AssertExpectedMessagesInRenderedMessages(messages, renderedMessages);
+ if (expectedLogMessageCount != null)
+ {
+ Assert.AreEqual((int) expectedLogMessageCount, renderedMessages.Count());
+ }
+ }
+
+ ///
+ /// Method use to perform any type of assertion on the generated log while performing
+ /// a particular action.
+ ///
+ /// Action to be performed while recording the log.
+ /// The assertion logic performed on the generated log-messages.
+ public static void AssertLogMessages(Action action, Action> assertLogMessages)
+ {
+ var renderedMessages = GetAllRenderedMessages(action);
+ assertLogMessages(renderedMessages);
+ }
+
+ ///
+ /// Checks the number of messages in the log.
+ ///
+ /// Action to be performed while recording the log
+ /// The expected number of messages
+ public static void AssertLogMessagesCount(Action action, int count)
+ {
+ var renderedMessages = GetAllRenderedMessages(action);
+
+ Assert.AreEqual(count, renderedMessages.Count());
+ }
+
+ ///
+ /// Asserts that two bitmap images are equal.
+ ///
+ /// The expected image.
+ /// The actual image.
+ /// When is not
+ /// equal to .
+ public static void AssertImagesAreEqual(Image expectedImage, Image actualImage)
+ {
+ if (expectedImage == null)
+ {
+ Assert.IsNull(actualImage);
+ return;
+ }
+ Assert.IsNotNull(actualImage);
+
+ Assert.AreEqual(expectedImage.Size, actualImage.Size);
+ IEnumerable expectedImageBytes = GetImageAsByteArray(expectedImage);
+ IEnumerable actualImageBytes = GetImageAsByteArray(actualImage);
+ CollectionAssert.AreEqual(expectedImageBytes, actualImageBytes);
+ }
+
+ ///
+ /// Asserts that a contains an item at the given
+ /// with the correct properties.
+ ///
+ /// The containing an item at position .
+ /// The position of the menu item in .
+ /// The text expected for the menu item.
+ /// The tooltip expected for the menu item.
+ /// The image expected for the menu item.
+ /// Optional: the expected enabled state of the menu item. Default: true.
+ /// When does not contain a menu item at
+ /// position with the right , or .
+ ///
+ public static void AssertContextMenuStripContainsItem(ContextMenuStrip menu, int position, string text, string toolTip, Image icon, bool enabled = true)
+ {
+ Assert.IsNotNull(menu);
+ Assert.Less(position, menu.Items.Count);
+
+ var item = menu.Items[position];
+
+ Assert.AreEqual(text, item.Text);
+ Assert.AreEqual(toolTip, item.ToolTipText);
+ Assert.AreEqual(enabled, item.Enabled);
+ AssertImagesAreEqual(icon, item.Image);
+ }
+
+ private static string GetCurrentTestClassMethodName()
+ {
+ var stackTrace = new StackTrace(false);
+
+ for (int i = 1; i < stackTrace.FrameCount; i++)
+ {
+ StackFrame stackFrame = stackTrace.GetFrame(i);
+ if (stackFrame.GetMethod().GetCustomAttributes(true).OfType().Count() != 0)
+ {
+ MethodBase method = stackFrame.GetMethod();
+ return method.DeclaringType.Name + "." + method.Name;
+ }
+ }
+
+ return "";
+ }
+
+ private static string GetSolutionRoot()
+ {
+ const string solutionName = "Ringtoets.sln";
+ //get the current directory and scope up
+ //TODO find a faster safer method
+ string curDir = ".";
+ while (Directory.Exists(curDir) && !File.Exists(curDir + @"\" + solutionName))
+ {
+ curDir += "/../";
+ }
+
+ if (!File.Exists(Path.Combine(curDir, solutionName)))
+ {
+ throw new InvalidOperationException("Solution file not found.");
+ }
+
+ return Path.GetFullPath(curDir);
+ }
+
+ private static float GetMachineHddPerformanceRank()
+ {
+ string rank = Environment.GetEnvironmentVariable("MACHINE_HDD_PERFORMANCE_RANK");
+ if (!String.IsNullOrEmpty(rank))
+ {
+ return Single.Parse(rank);
+ }
+
+ return 1.0f;
+ }
+
+ private static float GetMachinePerformanceRank()
+ {
+ string rank = Environment.GetEnvironmentVariable("MACHINE_PERFORMANCE_RANK");
+ if (!String.IsNullOrEmpty(rank))
+ {
+ return Single.Parse(rank);
+ }
+
+ return 1.0f;
+ }
+
+ private static void WriteTimesToLogFile(float maxMilliseconds, float actualMilliseconds, float machineRank, float machineHddRank, bool useHddAccessRank, string testName, bool includeCharts, string path)
+ {
+ if (!File.Exists(path))
+ {
+ if (!includeCharts)
+ {
+ File.AppendAllText(path, @"View with charts
");
+ }
+
+ if (machineRank != 1.0f)
+ {
+ File.AppendAllText(path, String.Format("Machine performance rank (multiplier):{0}
", machineRank));
+ File.AppendAllText(path, @"Time is in milliseconds
");
+ File.AppendAllText(path, String.Format("\n| Time | Name | {0}MaxTime | ActualTime | RankedActualTime | Percentage |
", includeCharts ? "Chart | " : ""));
+ }
+ else
+ {
+ File.AppendAllText(path, @"Time is in milliseconds
");
+ File.AppendAllText(path, String.Format("\n| Time | Name | {0}MaxTime | ActualTime | Percentage |
", includeCharts ? "Chart | " : ""));
+ }
+ }
+
+ string contents;
+
+ float rank = machineRank*(useHddAccessRank ? machineHddRank : 1.0f);
+
+ var chartContent = includeCharts ? String.Format(" | ", testName) : "";
+
+ float fraction;
+ if (machineRank != 1.0f)
+ {
+ contents = String.Format(CultureInfo.InvariantCulture,
+ "| {0} | {1} | {2}{3:G5} | {4:G5} | {5:G5} | ",
+ DateTime.Now, testName, chartContent, maxMilliseconds, actualMilliseconds, actualMilliseconds*rank);
+ fraction = (maxMilliseconds - actualMilliseconds*rank)/maxMilliseconds;
+ }
+ else
+ {
+ contents = String.Format(CultureInfo.InvariantCulture,
+ "
| {0} | {1} | {2}{3:G5} | {4:G5} | ", DateTime.Now, testName, chartContent,
+ maxMilliseconds, actualMilliseconds);
+ fraction = (maxMilliseconds - actualMilliseconds)/maxMilliseconds;
+ }
+
+ string color = ColorTranslator.ToHtml(GetPerformanceColor(fraction));
+ contents += String.Format(CultureInfo.InvariantCulture, "{1:G5}% | ", color, (100 - fraction*100));
+
+ contents += "
\n";
+ File.AppendAllText(path, contents);
+
+ // update test reports in JSON files on build server (tests statistics)
+ // TODO: find way to write it somewhere so that it will be shared between build agents
+
+ int buildNumber = 0;
+ string s = Environment.GetEnvironmentVariable("BUILD_NUMBER");
+ if (!String.IsNullOrEmpty(s))
+ {
+ buildNumber = Int32.Parse(s); // defined on build server
+ }
+
+ // generate JSON files locally
+ string testHistoryDirectoryPath = GetSolutionRoot() + "/target/performace-test-reports";
+ FileUtils.CreateDirectoryIfNotExists(testHistoryDirectoryPath);
+
+ string testHistoryFilePath = testHistoryDirectoryPath + Path.DirectorySeparatorChar + testName + ".json";
+
+ var testInfos = new List();
+
+ if (File.Exists(testHistoryFilePath))
+ {
+ testInfos = JsonConvert.DeserializeObject>(File.ReadAllText(testHistoryFilePath));
+ }
+
+ if (buildNumber == 0)
+ {
+ if (testInfos == null || testInfos.Count == 0)
+ {
+ testInfos = new List();
+ }
+ else
+ {
+ var maxBuildNumber = testInfos.Select(i => i.BuildNumber).Max();
+
+ // reset build numbers if they were not set
+ foreach (var testInfo in testInfos)
+ {
+ if (testInfo.BuildNumber == 0)
+ {
+ testInfo.BuildNumber = buildNumber;
+ buildNumber++;
+ }
+ }
+
+ buildNumber = maxBuildNumber + 1;
+ }
+ }
+
+ int maxTestInfoCount = 100; // max number of tests locally
+
+ while (testInfos.Count >= maxTestInfoCount)
+ {
+ testInfos.RemoveAt(0);
+ }
+
+ testInfos.Add(new TestRunInfo
+ {
+ TestName = testName,
+ Actual = actualMilliseconds,
+ ActualWeighted =
+ (int) (actualMilliseconds*machineRank*(useHddAccessRank ? machineHddRank : 1.0)),
+ Max = maxMilliseconds,
+ MachineHddRank = machineHddRank,
+ MachineRank = machineRank,
+ Time = DateTime.Now.ToString(CultureInfo.InvariantCulture),
+ BuildNumber = buildNumber,
+ UseMachineHddRank = useHddAccessRank
+ });
+
+ CreateChart(testInfos, testHistoryFilePath + ".html");
+
+ string json = JsonConvert.SerializeObject(testInfos, Formatting.Indented);
+ File.WriteAllText(testHistoryFilePath, json);
+ }
+
+ private static void CreateChart(List testInfos, string filePath)
+ {
+ var content = File.ReadAllText(SolutionRoot + "/Core/Common/test/Core.Common.TestUtil/test-data/chart.template.html");
+
+ var seriesPassed = "";
+ var seriesFailed = "";
+ var seriesThreshold = "";
+ for (var i = 0; i < testInfos.Count; i++)
+ {
+ var info = testInfos[i];
+ if (info.Actual > info.Max)
+ {
+ seriesFailed += "[" + info.BuildNumber + ", " + info.ActualWeighted + "], ";
+ }
+ else
+ {
+ seriesPassed += "[" + info.BuildNumber + ", " + info.ActualWeighted + "], ";
+ }
+
+ seriesThreshold += "[" + info.BuildNumber + ", " + info.Max + "], ";
+ }
+
+ content = content.Replace("$$SERIES_PASSED$$", seriesPassed);
+ content = content.Replace("$$SERIES_FAILED$$", seriesFailed);
+ content = content.Replace("$$SERIES_THRESHOLD$$", seriesThreshold);
+
+ File.WriteAllText(filePath, content);
+ }
+
+ private static Color GetPerformanceColor(double fraction)
+ {
+ if (fraction < 0)
+ {
+ return Color.Red;
+ }
+
+ if (colors == null)
+ {
+ var bitmap = new Bitmap(101, 1);
+ Graphics graphics = Graphics.FromImage(bitmap);
+
+ var rectangle = new Rectangle(0, 0, 101, 1);
+
+ var brush = new LinearGradientBrush(rectangle, Color.Green, Color.Yellow, 0.0f);
+
+ graphics.FillRectangle(brush, rectangle);
+
+ colors = new Color[101];
+ for (int i = 0; i < 101; i++)
+ {
+ colors[i] = bitmap.GetPixel(i, 0);
+ }
+ }
+
+ // 25% is the best result GREEN, less or greater than goes to yellow
+ var localValue = fraction >= 0.25 ? Math.Min(1, (fraction - 0.25)/0.75) : Math.Max(0, (0.25 - fraction)/0.25);
+
+ return colors[(int) (localValue*100.0)];
+ }
+
+ ///
+ /// Checks if all messages from occur in
+ ///
+ /// The collection of expected messages
+ /// The collection of messages in the log
+ private static void AssertExpectedMessagesInRenderedMessages(IEnumerable messages, IEnumerable renderedMessages)
+ {
+ foreach (string message in messages)
+ {
+ CollectionAssert.Contains(renderedMessages, message);
+ }
+ }
+
+ ///
+ /// Checks if none of the messages from occurs in
+ ///
+ /// The collection of unwanted messages
+ /// The collection of log messages in the log
+ private static void AssertUnwantedMessagesNotInRenderedMessages(IEnumerable messages, IEnumerable renderedMessages)
+ {
+ foreach (var renderedMessage in renderedMessages)
+ {
+ if (messages.Contains(renderedMessage))
+ {
+ Assert.Fail("Message \"{0}\" found in messages of log4net", renderedMessage);
+ }
+ }
+ }
+
+ private static IEnumerable GetAllRenderedMessages(Action action)
+ {
+ var memoryAppender = new MemoryAppender();
+ BasicConfigurator.Configure(memoryAppender);
+ LogHelper.SetLoggingLevel(Level.All);
+
+ action();
+
+ var renderedMessages = memoryAppender.GetEvents().Select(le => le.RenderedMessage).ToList();
+
+ memoryAppender.Close();
+ LogHelper.ResetLogging();
+
+ return renderedMessages;
+ }
+
+ #region Nested type: TestRunInfo
+
+ internal class TestRunInfo
+ {
+ public string Time;
+ public string TestName;
+ public float Actual; // millis
+ public float ActualWeighted; // millis
+ public float Max; // millis
+ public int BuildNumber;
+ public float MachineHddRank;
+ public float MachineRank;
+ public bool UseMachineHddRank;
+ }
+
+ #endregion
+
+ private static IEnumerable GetImageAsByteArray(Image expectedImage)
+ {
+ using (var stream = new MemoryStream())
+ {
+ expectedImage.Save(stream, expectedImage.RawFormat);
+ var length = stream.Length;
+ var imageBytes = new byte[length];
+ stream.Read(imageBytes, 0, (int)length);
+ return imageBytes;
+ }
+ }
+ }
+}
\ No newline at end of file
Index: Core/Common/test/Core.Common.TestUtil/WindowsFormsTestHelper.Designer.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.TestUtil/WindowsFormsTestHelper.Designer.cs (revision 0)
+++ Core/Common/test/Core.Common.TestUtil/WindowsFormsTestHelper.Designer.cs (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,118 @@
+using System.Windows.Forms;
+
+namespace Core.Common.TestUtil
+{
+ partial class WindowsFormsTestHelper
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+ this.splitContainer2 = new System.Windows.Forms.SplitContainer();
+ this.PropertyGrid = new System.Windows.Forms.PropertyGrid();
+ this.treeView1 = new System.Windows.Forms.TreeView();
+ this.splitContainer1.Panel1.SuspendLayout();
+ this.splitContainer1.SuspendLayout();
+ this.splitContainer2.Panel1.SuspendLayout();
+ this.splitContainer2.Panel2.SuspendLayout();
+ this.splitContainer2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // splitContainer1
+ //
+ this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer1.Location = new System.Drawing.Point(0, 0);
+ this.splitContainer1.Name = "splitContainer1";
+ //
+ // splitContainer1.Panel1
+ //
+ this.splitContainer1.Panel1.Controls.Add(this.splitContainer2);
+ this.splitContainer1.Size = new System.Drawing.Size(728, 490);
+ this.splitContainer1.SplitterDistance = 242;
+ this.splitContainer1.TabIndex = 0;
+ //
+ // splitContainer2
+ //
+ this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer2.Location = new System.Drawing.Point(0, 0);
+ this.splitContainer2.Name = "splitContainer2";
+ this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
+ //
+ // splitContainer2.Panel1
+ //
+ this.splitContainer2.Panel1.Controls.Add(this.treeView1);
+ //
+ // splitContainer2.Panel2
+ //
+ this.splitContainer2.Panel2.Controls.Add(this.PropertyGrid);
+ this.splitContainer2.Size = new System.Drawing.Size(242, 490);
+ this.splitContainer2.SplitterDistance = 251;
+ this.splitContainer2.TabIndex = 0;
+ //
+ // propertyGrid1
+ //
+ this.PropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.PropertyGrid.Location = new System.Drawing.Point(0, 0);
+ this.PropertyGrid.Name = "PropertyGrid";
+ this.PropertyGrid.Size = new System.Drawing.Size(242, 235);
+ this.PropertyGrid.TabIndex = 2;
+ //
+ // treeView1
+ //
+ this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.treeView1.ImageIndex = 0;
+ this.treeView1.LabelEdit = true;
+ this.treeView1.Location = new System.Drawing.Point(0, 0);
+ this.treeView1.Name = "treeView1";
+ this.treeView1.SelectedImageIndex = 0;
+ this.treeView1.Size = new System.Drawing.Size(242, 251);
+ this.treeView1.TabIndex = 0;
+ //
+ // WindowsFormsTestHelper
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(728, 490);
+ this.Controls.Add(this.splitContainer1);
+ this.Name = "WindowsFormsTestHelper";
+ this.Text = "WindowsFormsTestHelper";
+ this.splitContainer1.Panel1.ResumeLayout(false);
+ this.splitContainer1.ResumeLayout(false);
+ this.splitContainer2.Panel1.ResumeLayout(false);
+ this.splitContainer2.Panel2.ResumeLayout(false);
+ this.splitContainer2.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.SplitContainer splitContainer1;
+ private System.Windows.Forms.SplitContainer splitContainer2;
+ private TreeView treeView1;
+ }
+}
\ No newline at end of file
Index: Core/Common/test/Core.Common.TestUtil/WindowsFormsTestHelper.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.TestUtil/WindowsFormsTestHelper.cs (revision 0)
+++ Core/Common/test/Core.Common.TestUtil/WindowsFormsTestHelper.cs (revision d6e6eadf4a2521df75b6d371bacbb181a43058a3)
@@ -0,0 +1,282 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Windows.Forms;
+using NUnit.Framework;
+
+namespace Core.Common.TestUtil
+{
+ public partial class WindowsFormsTestHelper : Form
+ {
+ private static string nonModalControlsTestName; // current unit test name
+ private static readonly IList nonModalControls = new List();
+ private Action