Browse Source

Merge pull request #2143 from tig/unittests_refactor

Some refactoring of the unit tests
Tig 2 years ago
parent
commit
1d861019bf

+ 0 - 25
UnitTests/AssemblyInfo.cs

@@ -7,28 +7,3 @@ using Xunit;
 // Since Application is a singleton we can't run tests in parallel
 [assembly: CollectionBehavior (DisableTestParallelization = true)]
 
-// This class enables test functions annotated with the [AutoInitShutdown] attribute to 
-// automatically call Application.Init before called and Application.Shutdown after
-// 
-// This is necessary because a) Application is a singleton and Init/Shutdown must be called
-// as a pair, and b) all unit test functions should be atomic.
-[AttributeUsage (AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
-public class AutoInitShutdownAttribute : Xunit.Sdk.BeforeAfterTestAttribute {
-
-	static bool _init = false;
-	public override void Before (MethodInfo methodUnderTest)
-	{
-		if (_init) {
-			throw new InvalidOperationException ("After did not run.");
-		}
-
-		Application.Init (new FakeDriver (), new FakeMainLoop (() => FakeConsole.ReadKey (true)));
-		_init = true;
-	}
-
-	public override void After (MethodInfo methodUnderTest)
-	{
-		Application.Shutdown ();
-		_init = false;
-	}
-}

+ 13 - 13
UnitTests/ButtonTests.cs

@@ -29,7 +29,7 @@ namespace Terminal.Gui.Views {
 			var expected = @"
 [  ]
 ";
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 
 			Application.End (rs);
 			btn = new Button ("ARGS", true) { Text = "Test" };
@@ -47,7 +47,7 @@ namespace Terminal.Gui.Views {
 			expected = @"
 [◦ Test ◦]
 ";
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 
 			Application.End (rs);
 			btn = new Button (3, 4, "Test", true);
@@ -65,7 +65,7 @@ namespace Terminal.Gui.Views {
 			expected = @"
    [◦ Test ◦]
 ";
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 
 			Application.End (rs);
 		}
@@ -235,7 +235,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 5), pos);
 		}
 
@@ -273,7 +273,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 5), pos);
 		}
 
@@ -310,7 +310,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 		}
 
 		[Fact, AutoInitShutdown]
@@ -342,7 +342,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 
 			Assert.True (btn.AutoSize);
 			btn.Text = "Say Hello 你 changed";
@@ -356,7 +356,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 		}
 
 		[Fact, AutoInitShutdown]
@@ -389,7 +389,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 
 			Assert.True (btn.AutoSize);
 			btn.Text = "Say Hello 你 changed";
@@ -403,7 +403,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 		}
 
 		[Fact, AutoInitShutdown]
@@ -520,7 +520,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────────────────────────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 		}
 
 		[Fact, AutoInitShutdown]
@@ -550,7 +550,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 		}
 
 		[Fact, AutoInitShutdown]
@@ -582,7 +582,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 		}
 	}
 }

+ 19 - 19
UnitTests/CheckboxTests.cs

@@ -84,7 +84,7 @@ namespace Terminal.Gui.Views {
 √ Test
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 6, 1), pos);
 		}
 
@@ -123,7 +123,7 @@ namespace Terminal.Gui.Views {
 ";
 
 			// Positive test
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 5), pos);
 
 			// Also Positive test
@@ -139,7 +139,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 5), pos);
 
 			checkBox.Checked = true;
@@ -153,7 +153,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 5), pos);
 
 			checkBox.AutoSize = false;
@@ -169,7 +169,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 5), pos);
 
 			checkBox.Width = 19;
@@ -186,7 +186,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 5), pos);
 
 			checkBox.AutoSize = true;
@@ -200,7 +200,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 5), pos);
 		}
 
@@ -240,7 +240,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 5), pos);
 
 			checkBox.Checked = true;
@@ -253,7 +253,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 5), pos);
 		}
 
@@ -294,7 +294,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 5), pos);
 
 			checkBox.Checked = true;
@@ -307,7 +307,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 5), pos);
 		}
 
@@ -364,7 +364,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 6), pos);
 
 			checkBox1.Checked = true;
@@ -383,7 +383,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 6), pos);
 		}
 
@@ -424,7 +424,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 5), pos);
 
 			checkBox.Checked = true;
@@ -437,7 +437,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 5), pos);
 		}
 
@@ -470,7 +470,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 
 			Assert.True (checkBox.AutoSize);
 			checkBox.Text = "Check this out 你 changed";
@@ -484,7 +484,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 		}
 
 		[Fact, AutoInitShutdown]
@@ -516,7 +516,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 
 			Assert.True (checkBox.AutoSize);
 			checkBox.Text = "Check this out 你 changed";
@@ -530,7 +530,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 		}
 	}
 }

+ 10 - 10
UnitTests/ComboBoxTests.cs

@@ -144,7 +144,7 @@ namespace Terminal.Gui.Views {
 			Assert.Equal (0, cb.SelectedItem);
 			Assert.Equal ("One", cb.Text);
 			Application.Begin (Application.Top);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 One      ▼
 One       
 ", output);
@@ -154,7 +154,7 @@ One
 			Assert.Equal (1, cb.SelectedItem);
 			Assert.Equal ("Two", cb.Text);
 			Application.Begin (Application.Top);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 Two      ▼
 Two       
 ", output);
@@ -164,7 +164,7 @@ Two
 			Assert.Equal (2, cb.SelectedItem);
 			Assert.Equal ("Three", cb.Text);
 			Application.Begin (Application.Top);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 Three    ▼
 Three     
 ", output);
@@ -809,7 +809,7 @@ Three
 			Assert.Equal (-1, cb.SelectedItem);
 			Assert.Equal ("", cb.Text);
 			cb.Redraw (cb.Bounds);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 One   
 Two   
@@ -824,7 +824,7 @@ Three ", output);
 				cb.Subviews [1].GetNormalColor ()
 			};
 
-			GraphViewTests.AssertDriverColorsAre (@"
+			TestHelpers.AssertDriverColorsAre (@"
 000000
 00000
 22222
@@ -836,7 +836,7 @@ Three ", output);
 			Assert.Equal (-1, cb.SelectedItem);
 			Assert.Equal ("", cb.Text);
 			cb.Redraw (cb.Bounds);
-			GraphViewTests.AssertDriverColorsAre (@"
+			TestHelpers.AssertDriverColorsAre (@"
 000000
 22222
 00000
@@ -848,7 +848,7 @@ Three ", output);
 			Assert.Equal (-1, cb.SelectedItem);
 			Assert.Equal ("", cb.Text);
 			cb.Redraw (cb.Bounds);
-			GraphViewTests.AssertDriverColorsAre (@"
+			TestHelpers.AssertDriverColorsAre (@"
 000000
 22222
 22222
@@ -866,7 +866,7 @@ Three ", output);
 			Assert.Equal (2, cb.SelectedItem);
 			Assert.Equal ("Three", cb.Text);
 			cb.Redraw (cb.Bounds);
-			GraphViewTests.AssertDriverColorsAre (@"
+			TestHelpers.AssertDriverColorsAre (@"
 000000
 22222
 22222
@@ -878,7 +878,7 @@ Three ", output);
 			Assert.Equal (2, cb.SelectedItem);
 			Assert.Equal ("Three", cb.Text);
 			cb.Redraw (cb.Bounds);
-			GraphViewTests.AssertDriverColorsAre (@"
+			TestHelpers.AssertDriverColorsAre (@"
 000000
 22222
 00000
@@ -890,7 +890,7 @@ Three ", output);
 			Assert.Equal (2, cb.SelectedItem);
 			Assert.Equal ("Three", cb.Text);
 			cb.Redraw (cb.Bounds);
-			GraphViewTests.AssertDriverColorsAre (@"
+			TestHelpers.AssertDriverColorsAre (@"
 000000
 00000
 22222

+ 3 - 3
UnitTests/ConsoleDriverTests.cs

@@ -551,7 +551,7 @@ namespace Terminal.Gui.ConsoleDrivers {
 └────────────────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 10), pos);
 		}
 
@@ -581,7 +581,7 @@ namespace Terminal.Gui.ConsoleDrivers {
 └──────────────────┘
 ";
 
-					var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+					var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 					Assert.Equal (new Rect (0, 0, 20, 8), pos);
 
 					Assert.True (dlg.ProcessKey (new KeyEvent (Key.Tab, new KeyModifiers ())));
@@ -598,7 +598,7 @@ namespace Terminal.Gui.ConsoleDrivers {
 └──────────────────┘
 ";
 
-					pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+					pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 					Assert.Equal (new Rect (0, 0, 20, 8), pos);
 
 					win.RequestStop ();

+ 26 - 26
UnitTests/ContextMenuTests.cs

@@ -72,7 +72,7 @@ namespace Terminal.Gui.Core {
           └──────┘
 ";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			cm.Hide ();
 			Assert.False (ContextMenu.IsShow);
@@ -81,7 +81,7 @@ namespace Terminal.Gui.Core {
 
 			expected = "";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 		}
 
 		[Fact]
@@ -105,7 +105,7 @@ namespace Terminal.Gui.Core {
           └──────┘
 ";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			cm.Position = new Point (5, 10);
 
@@ -119,7 +119,7 @@ namespace Terminal.Gui.Core {
      └──────┘
 ";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 		}
 
@@ -144,7 +144,7 @@ namespace Terminal.Gui.Core {
           └──────┘
 ";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			cm.MenuItems = new MenuBarItem (new MenuItem [] {
 				new MenuItem ("First", "", null),
@@ -164,7 +164,7 @@ namespace Terminal.Gui.Core {
           └─────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 		}
 
@@ -271,7 +271,7 @@ namespace Terminal.Gui.Core {
                                                                         └──────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (72, 21, 80, 4), pos);
 
 			cm.Hide ();
@@ -312,7 +312,7 @@ namespace Terminal.Gui.Core {
                                                                       View    
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (70, 20, 78, 5), pos);
 
 			cm.Hide ();
@@ -347,7 +347,7 @@ namespace Terminal.Gui.Core {
           └──────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (10, 5, 18, 5), pos);
 
 			cm.Hide ();
@@ -370,7 +370,7 @@ namespace Terminal.Gui.Core {
      └──────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (5, 10, 13, 7), pos);
 
 			cm.Hide ();
@@ -401,7 +401,7 @@ namespace Terminal.Gui.Core {
 └────
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 1, 5, 4), pos);
 
 			cm.Hide ();
@@ -431,7 +431,7 @@ namespace Terminal.Gui.Core {
 │ Two  │
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 8, 3), pos);
 
 			cm.Hide ();
@@ -484,7 +484,7 @@ namespace Terminal.Gui.Core {
 └──────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 1, 8, 4), pos);
 
 			cm.ForceMinimumPosToZero = false;
@@ -498,7 +498,7 @@ namespace Terminal.Gui.Core {
 ──────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 7, 3), pos);
 		}
 
@@ -611,7 +611,7 @@ namespace Terminal.Gui.Core {
  F1 Help │ ^Q Quit              
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 32, 17), pos);
 		}
 
@@ -675,7 +675,7 @@ namespace Terminal.Gui.Core {
  F1 Help │ ^Q Quit                          
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 44, 17), pos);
 		}
 
@@ -707,7 +707,7 @@ namespace Terminal.Gui.Core {
 			Assert.Equal (new Point (-1, -2), cm.Position);
 			var top = Application.Top;
 			Application.Begin (top);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌────────┐
 │ One    │
 │ Two    │
@@ -726,7 +726,7 @@ namespace Terminal.Gui.Core {
 			}));
 			Application.Refresh ();
 			Assert.Equal (new Point (-1, -2), cm.Position);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌────────┐             
 │ One    │             
 │ Two    │             
@@ -747,7 +747,7 @@ namespace Terminal.Gui.Core {
 			cm.Show ();
 			Application.Refresh ();
 			Assert.Equal (new Point (41, -2), cm.Position);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
                               ┌────────┐
                               │ One    │
                               │ Two    │
@@ -766,7 +766,7 @@ namespace Terminal.Gui.Core {
 			}));
 			Application.Refresh ();
 			Assert.Equal (new Point (41, -2), cm.Position);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
                               ┌────────┐
                               │ One    │
                               │ Two    │
@@ -786,7 +786,7 @@ namespace Terminal.Gui.Core {
 			cm.Show ();
 			Application.Refresh ();
 			Assert.Equal (new Point (41, 9), cm.Position);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
                               ┌────────┐
                               │ One    │
                               │ Two    │
@@ -805,7 +805,7 @@ namespace Terminal.Gui.Core {
 			}));
 			Application.Refresh ();
 			Assert.Equal (new Point (41, 9), cm.Position);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
                               ┌────────┐
                  ┌───────────┐│ One    │
                  │ SubMenu1  ││ Two    │
@@ -822,7 +822,7 @@ namespace Terminal.Gui.Core {
 			cm.Show ();
 			Application.Refresh ();
 			Assert.Equal (new Point (41, 22), cm.Position);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
                               ┌────────┐
                               │ One    │
                               │ Two    │
@@ -841,7 +841,7 @@ namespace Terminal.Gui.Core {
 			}));
 			Application.Refresh ();
 			Assert.Equal (new Point (41, 22), cm.Position);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
                  ┌───────────┐          
                  │ SubMenu1  │┌────────┐
                  │ SubMenu2  ││ One    │
@@ -858,7 +858,7 @@ namespace Terminal.Gui.Core {
 			cm.Show ();
 			Application.Refresh ();
 			Assert.Equal (new Point (19, 10), cm.Position);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
         ┌────────┐
         │ One    │
         │ Two    │
@@ -877,7 +877,7 @@ namespace Terminal.Gui.Core {
 			}));
 			Application.Refresh ();
 			Assert.Equal (new Point (19, 10), cm.Position);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌───────────┐────┐
 │ SubMenu1  │    │
 │ SubMenu2  │    │

+ 38 - 38
UnitTests/DialogTests.cs

@@ -43,28 +43,28 @@ namespace Terminal.Gui.Views {
 			d.SetBufferSize (width, 3);
 
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Center, new Button (btnText));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Justify
 			buttonRow = $"{d.VLine}      {d.LeftBracket} {btnText} {d.RightBracket}{d.VLine}";
 			Assert.Equal (width, buttonRow.Length);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Justify, new Button (btnText));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Right
 			buttonRow = $"{d.VLine}      {d.LeftBracket} {btnText} {d.RightBracket}{d.VLine}";
 			Assert.Equal (width, buttonRow.Length);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Right, new Button (btnText));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Left
 			buttonRow = $"{d.VLine}{d.LeftBracket} {btnText} {d.RightBracket}      {d.VLine}";
 			Assert.Equal (width, buttonRow.Length);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Left, new Button (btnText));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 		}
 
@@ -91,28 +91,28 @@ namespace Terminal.Gui.Views {
 			d.SetBufferSize (buttonRow.Length, 3);
 
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Center, new Button (btn1Text), new Button (btn2Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Justify
 			buttonRow = $@"{d.VLine}{btn1}   {btn2}{d.VLine}";
 			Assert.Equal (width, buttonRow.Length);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Justify, new Button (btn1Text), new Button (btn2Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Right
 			buttonRow = $@"{d.VLine}  {btn1} {btn2}{d.VLine}";
 			Assert.Equal (width, buttonRow.Length);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Right, new Button (btn1Text), new Button (btn2Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Left
 			buttonRow = $@"{d.VLine}{btn1} {btn2}  {d.VLine}";
 			Assert.Equal (width, buttonRow.Length);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Left, new Button (btn1Text), new Button (btn2Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 		}
 
@@ -149,7 +149,7 @@ namespace Terminal.Gui.Views {
 			//button1.Visible = false;
 			//Application.RunMainLoopIteration (ref runstate, true, ref firstIteration);
 			//buttonRow = $@"{d.VLine}         {btn2} {d.VLine}";
-			//GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			//DriverAsserts.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			//Application.End (runstate);
 
 			// Justify
@@ -160,21 +160,21 @@ namespace Terminal.Gui.Views {
 			button1.Visible = false;
 			Application.RunMainLoopIteration (ref runstate, true, ref firstIteration);
 			buttonRow = $@"{d.VLine}          {btn2}{d.VLine}";
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			//// Right
 			//buttonRow = $@"{d.VLine}  {btn1} {btn2}{d.VLine}";
 			//Assert.Equal (width, buttonRow.Length);
 			//(runstate, dlg) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Right, new Button (btn1Text), new Button (btn2Text));
-			//GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			//DriverAsserts.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			//Application.End (runstate);
 
 			//// Left
 			//buttonRow = $@"{d.VLine}{btn1} {btn2}  {d.VLine}";
 			//Assert.Equal (width, buttonRow.Length);
 			//(runstate, dlg) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Left, new Button (btn1Text), new Button (btn2Text));
-			//GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			//DriverAsserts.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			//Application.End (runstate);
 		}
 
@@ -203,28 +203,28 @@ namespace Terminal.Gui.Views {
 			d.SetBufferSize (buttonRow.Length, 3);
 
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Center, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Justify
 			buttonRow = $@"{d.VLine}{btn1}  {btn2}  {btn3}{d.VLine}";
 			Assert.Equal (width, buttonRow.Length);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Justify, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Right
 			buttonRow = $@"{d.VLine}  {btn1} {btn2} {btn3}{d.VLine}";
 			Assert.Equal (width, buttonRow.Length);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Right, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Left
 			buttonRow = $@"{d.VLine}{btn1} {btn2} {btn3}  {d.VLine}";
 			Assert.Equal (width, buttonRow.Length);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Left, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 		}
 
@@ -256,28 +256,28 @@ namespace Terminal.Gui.Views {
 
 			// Default - Center
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Center, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Justify
 			buttonRow = $"{d.VLine}{btn1} {btn2}  {btn3}  {btn4}{d.VLine}";
 			Assert.Equal (width, buttonRow.Length);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Justify, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Right
 			buttonRow = $"{d.VLine}  {btn1} {btn2} {btn3} {btn4}{d.VLine}";
 			Assert.Equal (width, buttonRow.Length);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Right, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Left
 			buttonRow = $"{d.VLine}{btn1} {btn2} {btn3} {btn4}  {d.VLine}";
 			Assert.Equal (width, buttonRow.Length);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Left, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 		}
 
@@ -312,28 +312,28 @@ namespace Terminal.Gui.Views {
 
 			// Default - Center
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Center, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Justify
 			buttonRow = $"{d.VLine}{btn1}    {btn2}     {btn3}     {btn4}{d.VLine}";
 			Assert.Equal (width, ustring.Make (buttonRow).ConsoleWidth);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Justify, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Right
 			buttonRow = $"{d.VLine}           {btn1} {btn2} {btn3} {btn4}{d.VLine}";
 			Assert.Equal (width, ustring.Make (buttonRow).ConsoleWidth);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Right, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Left
 			buttonRow = $"{d.VLine}{btn1} {btn2} {btn3} {btn4}           {d.VLine}";
 			Assert.Equal (width, ustring.Make (buttonRow).ConsoleWidth);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Left, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 		}
 
@@ -367,28 +367,28 @@ namespace Terminal.Gui.Views {
 
 			// Default - Center
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Center, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Justify
 			buttonRow = $"{d.VLine}{btn1}    {btn2}     {btn3}     {btn4}{d.VLine}";
 			Assert.Equal (width, buttonRow.Length);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Justify, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Right
 			buttonRow = $"{d.VLine}           {btn1} {btn2} {btn3} {btn4}{d.VLine}";
 			Assert.Equal (width, buttonRow.Length);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Right, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Left
 			buttonRow = $"{d.VLine}{btn1} {btn2} {btn3} {btn4}           {d.VLine}";
 			Assert.Equal (width, buttonRow.Length);
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Left, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 		}
 
@@ -409,7 +409,7 @@ namespace Terminal.Gui.Views {
 			d.SetBufferSize (buttonRow.Length, 3);
 
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Center, null);
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 
 			Application.End (runstate);
 		}
@@ -432,7 +432,7 @@ namespace Terminal.Gui.Views {
 			d.SetBufferSize (buttonRow.Length, 3);
 
 			(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Center, new Button (btnText));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 		}
 
@@ -461,56 +461,56 @@ namespace Terminal.Gui.Views {
 			var dlg = new Dialog (title, width, 3, new Button (btn1Text)) { ButtonAlignment = Dialog.ButtonAlignments.Center };
 			runstate = Application.Begin (dlg);
 			var buttonRow = $"{d.VLine}    {btn1}     {d.VLine}";
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 
 			// Now add a second button
 			buttonRow = $"{d.VLine} {btn1} {btn2} {d.VLine}";
 			dlg.AddButton (new Button (btn2Text));
 			bool first = false;
 			Application.RunMainLoopIteration (ref runstate, true, ref first);
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Justify
 			dlg = new Dialog (title, width, 3, new Button (btn1Text)) { ButtonAlignment = Dialog.ButtonAlignments.Justify };
 			runstate = Application.Begin (dlg);
 			buttonRow = $"{d.VLine}         {btn1}{d.VLine}";
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 
 			// Now add a second button
 			buttonRow = $"{d.VLine}{btn1}   {btn2}{d.VLine}";
 			dlg.AddButton (new Button (btn2Text));
 			first = false;
 			Application.RunMainLoopIteration (ref runstate, true, ref first);
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Right
 			dlg = new Dialog (title, width, 3, new Button (btn1Text)) { ButtonAlignment = Dialog.ButtonAlignments.Right };
 			runstate = Application.Begin (dlg);
 			buttonRow = $"{d.VLine}{new String (' ', width - btn1.Length - 2)}{btn1}{d.VLine}";
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 
 			// Now add a second button
 			buttonRow = $"{d.VLine}  {btn1} {btn2}{d.VLine}";
 			dlg.AddButton (new Button (btn2Text));
 			first = false;
 			Application.RunMainLoopIteration (ref runstate, true, ref first);
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 
 			// Left
 			dlg = new Dialog (title, width, 3, new Button (btn1Text)) { ButtonAlignment = Dialog.ButtonAlignments.Left };
 			runstate = Application.Begin (dlg);
 			buttonRow = $"{d.VLine}{btn1}{new String (' ', width - btn1.Length - 2)}{d.VLine}";
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 
 			// Now add a second button
 			buttonRow = $"{d.VLine}{btn1} {btn2}  {d.VLine}";
 			dlg.AddButton (new Button (btn2Text));
 			first = false;
 			Application.RunMainLoopIteration (ref runstate, true, ref first);
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 		}
 	}

+ 2 - 2
UnitTests/DimTests.cs

@@ -1002,7 +1002,7 @@ namespace Terminal.Gui.Core {
 			field.KeyDown += (k) => {
 				if (k.KeyEvent.Key == Key.Enter) {
 					((FakeDriver)Application.Driver).SetBufferSize (22, count + 4);
-					var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expecteds [count], output);
+					var pos = TestHelpers.AssertDriverContentsWithFrameAre (expecteds [count], output);
 					Assert.Equal (new Rect (0, 0, 22, count + 4), pos);
 
 					if (count < 20) {
@@ -1148,7 +1148,7 @@ namespace Terminal.Gui.Core {
 			field.KeyDown += (k) => {
 				if (k.KeyEvent.Key == Key.Enter) {
 					((FakeDriver)Application.Driver).SetBufferSize (22, count + 4);
-					var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expecteds [count], output);
+					var pos = TestHelpers.AssertDriverContentsWithFrameAre (expecteds [count], output);
 					Assert.Equal (new Rect (0, 0, 22, count + 4), pos);
 
 					if (count > 0) {

+ 18 - 204
UnitTests/GraphViewTests.cs

@@ -93,192 +93,6 @@ namespace Terminal.Gui.Views {
 			return gv;
 		}
 
-#pragma warning disable xUnit1013 // Public method should be marked as test
-		public static void AssertDriverContentsAre (string expectedLook, ITestOutputHelper output)
-		{
-#pragma warning restore xUnit1013 // Public method should be marked as test
-
-			var sb = new StringBuilder ();
-			var driver = ((FakeDriver)Application.Driver);
-
-			var contents = driver.Contents;
-
-			for (int r = 0; r < driver.Rows; r++) {
-				for (int c = 0; c < driver.Cols; c++) {
-					sb.Append ((char)contents [r, c, 0]);
-				}
-				sb.AppendLine ();
-			}
-
-			var actualLook = sb.ToString ();
-
-			if (!string.Equals (expectedLook, actualLook)) {
-
-				// ignore trailing whitespace on each line
-				var trailingWhitespace = new Regex (@"\s+$", RegexOptions.Multiline);
-
-				// get rid of trailing whitespace on each line (and leading/trailing whitespace of start/end of full string)
-				expectedLook = trailingWhitespace.Replace (expectedLook, "").Trim ();
-				actualLook = trailingWhitespace.Replace (actualLook, "").Trim ();
-
-				// standardize line endings for the comparison
-				expectedLook = expectedLook.Replace ("\r\n", "\n");
-				actualLook = actualLook.Replace ("\r\n", "\n");
-
-				output?.WriteLine ("Expected:" + Environment.NewLine + expectedLook);
-				output?.WriteLine ("But Was:" + Environment.NewLine + actualLook);
-
-				Assert.Equal (expectedLook, actualLook);
-			}
-		}
-
-		public static Rect AssertDriverContentsWithFrameAre (string expectedLook, ITestOutputHelper output)
-		{
-			var lines = new List<List<char>> ();
-			var sb = new StringBuilder ();
-			var driver = ((FakeDriver)Application.Driver);
-			var x = -1;
-			var y = -1;
-			int w = -1;
-			int h = -1;
-
-			var contents = driver.Contents;
-
-			for (int r = 0; r < driver.Rows; r++) {
-				var runes = new List<char> ();
-				for (int c = 0; c < driver.Cols; c++) {
-					var rune = (char)contents [r, c, 0];
-					if (rune != ' ') {
-						if (x == -1) {
-							x = c;
-							y = r;
-							for (int i = 0; i < c; i++) {
-								runes.InsertRange (i, new List<char> () { ' ' });
-							}
-						}
-						if (Rune.ColumnWidth (rune) > 1) {
-							c++;
-						}
-						if (c + 1 > w) {
-							w = c + 1;
-						}
-						h = r - y + 1;
-					}
-					if (x > -1) {
-						runes.Add (rune);
-					}
-				}
-				if (runes.Count > 0) {
-					lines.Add (runes);
-				}
-			}
-
-			// Remove unnecessary empty lines
-			if (lines.Count > 0) {
-				for (int r = lines.Count - 1; r > h - 1; r--) {
-					lines.RemoveAt (r);
-				}
-			}
-
-			// Remove trailing whitespace on each line
-			for (int r = 0; r < lines.Count; r++) {
-				List<char> row = lines [r];
-				for (int c = row.Count - 1; c >= 0; c--) {
-					var rune = row [c];
-					if (rune != ' ' || (row.Sum (x => Rune.ColumnWidth (x)) == w)) {
-						break;
-					}
-					row.RemoveAt (c);
-				}
-			}
-
-			// Convert char list to string
-			for (int r = 0; r < lines.Count; r++) {
-				var line = new string (lines [r].ToArray ());
-				if (r == lines.Count - 1) {
-					sb.Append (line);
-				} else {
-					sb.AppendLine (line);
-				}
-			}
-
-			var actualLook = sb.ToString ();
-
-			if (!string.Equals (expectedLook, actualLook)) {
-
-				// standardize line endings for the comparison
-				expectedLook = expectedLook.Replace ("\r\n", "\n");
-				actualLook = actualLook.Replace ("\r\n", "\n");
-
-				// Remove the first and the last line ending from the expectedLook
-				if (expectedLook.StartsWith ("\n")) {
-					expectedLook = expectedLook [1..];
-				}
-				if (expectedLook.EndsWith ("\n")) {
-					expectedLook = expectedLook [..^1];
-				}
-
-				output?.WriteLine ("Expected:" + Environment.NewLine + expectedLook);
-				output?.WriteLine ("But Was:" + Environment.NewLine + actualLook);
-
-				Assert.Equal (expectedLook, actualLook);
-			}
-			return new Rect (x > -1 ? x : 0, y > -1 ? y : 0, w > -1 ? w : 0, h > -1 ? h : 0);
-		}
-
-#pragma warning disable xUnit1013 // Public method should be marked as test
-		/// <summary>
-		/// Verifies the console was rendered using the given <paramref name="expectedColors"/> at the given locations.
-		/// Pass a bitmap of indexes into <paramref name="expectedColors"/> as <paramref name="expectedLook"/> and the
-		/// test method will verify those colors were used in the row/col of the console during rendering
-		/// </summary>
-		/// <param name="expectedLook">Numbers between 0 and 9 for each row/col of the console.  Must be valid indexes of <paramref name="expectedColors"/></param>
-		/// <param name="expectedColors"></param>
-		public static void AssertDriverColorsAre (string expectedLook, Attribute [] expectedColors)
-		{
-#pragma warning restore xUnit1013 // Public method should be marked as test
-
-			if (expectedColors.Length > 10) {
-				throw new ArgumentException ("This method only works for UIs that use at most 10 colors");
-			}
-
-			expectedLook = expectedLook.Trim ();
-			var driver = ((FakeDriver)Application.Driver);
-
-			var contents = driver.Contents;
-
-			int r = 0;
-			foreach (var line in expectedLook.Split ('\n').Select (l => l.Trim ())) {
-
-				for (int c = 0; c < line.Length; c++) {
-
-					int val = contents [r, c, 1];
-
-					var match = expectedColors.Where (e => e.Value == val).ToList ();
-					if (match.Count == 0) {
-						throw new Exception ($"Unexpected color {DescribeColor (val)} was used at row {r} and col {c} (indexes start at 0).  Color value was {val} (expected colors were {string.Join (",", expectedColors.Select (c => c.Value))})");
-					} else if (match.Count > 1) {
-						throw new ArgumentException ($"Bad value for expectedColors, {match.Count} Attributes had the same Value");
-					}
-
-					var colorUsed = Array.IndexOf (expectedColors, match [0]).ToString () [0];
-					var userExpected = line [c];
-
-					if (colorUsed != userExpected) {
-						throw new Exception ($"Colors used did not match expected at row {r} and col {c} (indexes start at 0).  Color index used was {DescribeColor (colorUsed)} but test expected {DescribeColor (userExpected)} (these are indexes into the expectedColors array)");
-					}
-				}
-
-				r++;
-			}
-		}
-
-		private static object DescribeColor (int userExpected)
-		{
-			var a = new Attribute (userExpected);
-			return $"{a.Foreground},{a.Background}";
-		}
-
 		#region Screen to Graph Tests
 
 		[Fact]
@@ -833,7 +647,7 @@ namespace Terminal.Gui.Views {
  │  MM  MM  MM
  ┼──┬M──┬M──┬M──────
    heytherebob  ";
-			GraphViewTests.AssertDriverContentsAre (looksLike, output);
+			TestHelpers.AssertDriverContentsAre (looksLike, output);
 
 			// Shutdown must be called to safely clean up Application if Init has been called
 			Application.Shutdown ();
@@ -1253,7 +1067,7 @@ namespace Terminal.Gui.Views {
 0┼┬┬┬┬┬┬┬┬
  0    5";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			// user scrolls up one unit of graph space
 			gv.ScrollOffset = new PointF (0, 1f);
@@ -1270,7 +1084,7 @@ namespace Terminal.Gui.Views {
 1┼┬┬┬┬┬┬┬┬
  0    5";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			// Shutdown must be called to safely clean up Application if Init has been called
 			Application.Shutdown ();
@@ -1297,7 +1111,7 @@ namespace Terminal.Gui.Views {
 0┼┬┬┬┬┬┬┬┬
  0    5";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			// user scrolls up one unit of graph space
 			gv.ScrollOffset = new PointF (0, 1f);
@@ -1315,7 +1129,7 @@ namespace Terminal.Gui.Views {
 1┼┬┬┬┬┬┬┬┬
  0    5";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			// Shutdown must be called to safely clean up Application if Init has been called
 			Application.Shutdown ();
@@ -1345,7 +1159,7 @@ namespace Terminal.Gui.Views {
 0┼┬┬┬┬┬┬┬┬
  0    5";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			// Shutdown must be called to safely clean up Application if Init has been called
@@ -1374,7 +1188,7 @@ namespace Terminal.Gui.Views {
 0┼┬┬┬┬┬┬┬┬
  0    5";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			// Shutdown must be called to safely clean up Application if Init has been called
 			Application.Shutdown ();
@@ -1409,7 +1223,7 @@ namespace Terminal.Gui.Views {
 0┼┬┬┬┬┬┬┬┬
  0    5";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			// Shutdown must be called to safely clean up Application if Init has been called
@@ -1444,7 +1258,7 @@ namespace Terminal.Gui.Views {
 0┼┬┬┬┬┬┬┬┬
  0    5";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			// Shutdown must be called to safely clean up Application if Init has been called
@@ -1473,7 +1287,7 @@ namespace Terminal.Gui.Views {
 0┼┬┬┬┬┬┬┬┬
  0    5";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			// Shutdown must be called to safely clean up Application if Init has been called
@@ -1515,7 +1329,7 @@ namespace Terminal.Gui.Views {
 0┼┬┬┬┬┬┬┬┬
  0    5";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			// Shutdown must be called to safely clean up Application if Init has been called
@@ -1554,7 +1368,7 @@ namespace Terminal.Gui.Views {
  0    5   
           
           ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			// Shutdown must be called to safely clean up Application if Init has been called
@@ -1595,7 +1409,7 @@ namespace Terminal.Gui.Views {
    0    5
          
           ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			// Shutdown must be called to safely clean up Application if Init has been called
@@ -1622,7 +1436,7 @@ namespace Terminal.Gui.Views {
          
          
           ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			// Shutdown must be called to safely clean up Application if Init has been called
@@ -1647,7 +1461,7 @@ namespace Terminal.Gui.Views {
          
          
           ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			// Shutdown must be called to safely clean up Application if Init has been called
@@ -1679,7 +1493,7 @@ namespace Terminal.Gui.Views {
 0┼┬┬┬┬┬┬┬┬
  0    5";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			// Shutdown must be called to safely clean up Application if Init has been called
@@ -1726,14 +1540,14 @@ namespace Terminal.Gui.Views {
 				mount.Redraw (mount.Bounds);
 
 				// should have the initial text
-				GraphViewTests.AssertDriverContentsAre ("ff", null);
+				TestHelpers.AssertDriverContentsAre ("ff", null);
 
 				// change the text and redraw
 				lbl1.Text = "ff1234";
 				mount.Redraw (mount.Bounds);
 
 				// should have the new text rendered
-				GraphViewTests.AssertDriverContentsAre ("ff1234", null);
+				TestHelpers.AssertDriverContentsAre ("ff1234", null);
 
 
 			} finally {

+ 11 - 11
UnitTests/ListViewTests.cs

@@ -247,7 +247,7 @@ namespace Terminal.Gui.Views {
 			Application.Refresh ();
 
 			Assert.Equal (0, lv.SelectedItem);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──────────┐
 │Line0     │
 │Line1     │
@@ -264,7 +264,7 @@ namespace Terminal.Gui.Views {
 			Assert.True (lv.ScrollDown (10));
 			lv.Redraw (lv.Bounds);
 			Assert.Equal (0, lv.SelectedItem);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──────────┐
 │Line10    │
 │Line11    │
@@ -281,7 +281,7 @@ namespace Terminal.Gui.Views {
 			Assert.True (lv.MoveDown ());
 			lv.Redraw (lv.Bounds);
 			Assert.Equal (1, lv.SelectedItem);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──────────┐
 │Line1     │
 │Line2     │
@@ -298,7 +298,7 @@ namespace Terminal.Gui.Views {
 			Assert.True (lv.MoveEnd ());
 			lv.Redraw (lv.Bounds);
 			Assert.Equal (19, lv.SelectedItem);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──────────┐
 │Line19    │
 │          │
@@ -315,7 +315,7 @@ namespace Terminal.Gui.Views {
 			Assert.True (lv.ScrollUp (20));
 			lv.Redraw (lv.Bounds);
 			Assert.Equal (19, lv.SelectedItem);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──────────┐
 │Line0     │
 │Line1     │
@@ -332,7 +332,7 @@ namespace Terminal.Gui.Views {
 			Assert.True (lv.MoveDown ());
 			lv.Redraw (lv.Bounds);
 			Assert.Equal (19, lv.SelectedItem);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──────────┐
 │Line10    │
 │Line11    │
@@ -349,7 +349,7 @@ namespace Terminal.Gui.Views {
 			Assert.True (lv.ScrollUp (20));
 			lv.Redraw (lv.Bounds);
 			Assert.Equal (19, lv.SelectedItem);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──────────┐
 │Line0     │
 │Line1     │
@@ -366,7 +366,7 @@ namespace Terminal.Gui.Views {
 			Assert.True (lv.MoveDown ());
 			lv.Redraw (lv.Bounds);
 			Assert.Equal (19, lv.SelectedItem);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──────────┐
 │Line10    │
 │Line11    │
@@ -383,7 +383,7 @@ namespace Terminal.Gui.Views {
 			Assert.True (lv.MoveHome ());
 			lv.Redraw (lv.Bounds);
 			Assert.Equal (0, lv.SelectedItem);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──────────┐
 │Line0     │
 │Line1     │
@@ -400,7 +400,7 @@ namespace Terminal.Gui.Views {
 			Assert.True (lv.ScrollDown (20));
 			lv.Redraw (lv.Bounds);
 			Assert.Equal (0, lv.SelectedItem);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──────────┐
 │Line19    │
 │          │
@@ -417,7 +417,7 @@ namespace Terminal.Gui.Views {
 			Assert.True (lv.MoveUp ());
 			lv.Redraw (lv.Bounds);
 			Assert.Equal (0, lv.SelectedItem);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──────────┐
 │Line0     │
 │Line1     │

+ 54 - 54
UnitTests/MenuTests.cs

@@ -150,7 +150,7 @@ Edit
 │ Copy   Copies the selection. │
 └──────────────────────────────┘
 ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			cancelClosing = true;
 			Assert.True (menu.ProcessHotKey (new KeyEvent (Key.F9, new KeyModifiers ())));
@@ -163,7 +163,7 @@ Edit
 │ Copy   Copies the selection. │
 └──────────────────────────────┘
 ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			cancelClosing = false;
 			Assert.True (menu.ProcessHotKey (new KeyEvent (Key.F9, new KeyModifiers ())));
@@ -173,7 +173,7 @@ Edit
 			expected = @"
 Edit
 ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			void New () => miAction = "New";
 			void Copy () => miAction = "Copy";
@@ -608,7 +608,7 @@ Edit
 └──────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 1, 8, 4), pos);
 		}
 
@@ -637,7 +637,7 @@ Edit
 ──────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 7, 4), pos);
 
 			menu.CloseAllMenus ();
@@ -651,7 +651,7 @@ Edit
 ──────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 7, 3), pos);
 
 			menu.CloseAllMenus ();
@@ -667,7 +667,7 @@ Edit
 └──────
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 1, 7, 4), pos);
 
 			menu.CloseAllMenus ();
@@ -682,7 +682,7 @@ Edit
 │ Two  
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 7, 3), pos);
 		}
 
@@ -710,7 +710,7 @@ Edit
  Numbers
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 
 			Assert.True (menu.ProcessHotKey (new KeyEvent (Key.F9, null)));
 			Application.Top.Redraw (Application.Top.Bounds);
@@ -723,7 +723,7 @@ Edit
 └────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 
 			Assert.True (Application.Top.Subviews [1].ProcessKey (new KeyEvent (Key.CursorDown, null)));
 			Application.Top.Redraw (Application.Top.Bounds);
@@ -737,7 +737,7 @@ Edit
           └─────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 
 			Assert.True (Application.Top.Subviews [2].ProcessKey (new KeyEvent (Key.CursorLeft, null)));
 			Application.Top.Redraw (Application.Top.Bounds);
@@ -750,7 +750,7 @@ Edit
 └────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 
 			Assert.True (Application.Top.Subviews [1].ProcessKey (new KeyEvent (Key.Esc, null)));
 			Application.Top.Redraw (Application.Top.Bounds);
@@ -758,7 +758,7 @@ Edit
  Numbers
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 		}
 
 		[Fact, AutoInitShutdown]
@@ -785,7 +785,7 @@ Edit
  Numbers
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 8, 1), pos);
 
 			Assert.True (menu.MouseEvent (new MouseEvent () {
@@ -804,7 +804,7 @@ Edit
 └────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 10, 6), pos);
 
 			Assert.False (menu.MouseEvent (new MouseEvent () {
@@ -824,7 +824,7 @@ Edit
           └─────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 25, 7), pos);
 
 			Assert.False (menu.MouseEvent (new MouseEvent () {
@@ -843,7 +843,7 @@ Edit
 └────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 10, 6), pos);
 
 			Assert.False (menu.MouseEvent (new MouseEvent () {
@@ -857,7 +857,7 @@ Edit
  Numbers
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 8, 1), pos);
 		}
 
@@ -887,7 +887,7 @@ Edit
  Numbers
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 8, 1), pos);
 
 			Assert.True (menu.ProcessHotKey (new KeyEvent (Key.F9, null)));
@@ -901,7 +901,7 @@ Edit
 └────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 10, 6), pos);
 
 			Assert.True (Application.Top.Subviews [1].ProcessKey (new KeyEvent (Key.CursorDown, null)));
@@ -917,7 +917,7 @@ Edit
 └─────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 15, 7), pos);
 
 			Assert.True (Application.Top.Subviews [2].ProcessKey (new KeyEvent (Key.Enter, null)));
@@ -931,7 +931,7 @@ Edit
 └────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 10, 6), pos);
 
 			Assert.True (Application.Top.Subviews [1].ProcessKey (new KeyEvent (Key.Esc, null)));
@@ -940,7 +940,7 @@ Edit
  Numbers
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 8, 1), pos);
 		}
 
@@ -970,7 +970,7 @@ Edit
  Numbers
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 8, 1), pos);
 
 			Assert.True (menu.MouseEvent (new MouseEvent () {
@@ -989,7 +989,7 @@ Edit
 └────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 10, 6), pos);
 
 			Assert.False (menu.MouseEvent (new MouseEvent () {
@@ -1009,7 +1009,7 @@ Edit
 └─────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 15, 7), pos);
 
 			Assert.False (menu.MouseEvent (new MouseEvent () {
@@ -1028,7 +1028,7 @@ Edit
 └────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 10, 6), pos);
 
 			Assert.False (menu.MouseEvent (new MouseEvent () {
@@ -1042,7 +1042,7 @@ Edit
  Numbers
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 8, 1), pos);
 		}
 
@@ -1074,7 +1074,7 @@ Edit
  File  Edit
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 11, 1), pos);
 
 			Assert.True (menu.ProcessKey (new (Key.N, null)));
@@ -1088,7 +1088,7 @@ Edit
  File  Edit
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 0, 11, 1), pos);
 
 			Assert.True (menu.ProcessKey (new (Key.CursorRight, null)));
@@ -1205,13 +1205,13 @@ Edit
 			Application.Top.Add (menu);
 
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.ClosedMenuText, output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.ClosedMenuText, output);
 
 			for (var i = 0; i < expectedMenu.Menus.Length; i++) {
 				menu.OpenMenu (i);
 				Assert.True (menu.IsMenuOpen);
 				Application.Top.Redraw (Application.Top.Bounds);
-				GraphViewTests.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (i), output);
+				TestHelpers.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (i), output);
 			}
 		}
 
@@ -1249,7 +1249,7 @@ Edit
 			Assert.True (menu.ProcessHotKey (new (Key.AltMask | Key.F, new KeyModifiers () { Alt = true })));
 			Assert.True (menu.IsMenuOpen);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (0), output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (0), output);
 
 			Assert.True (Application.Top.Subviews [1].ProcessKey (new (Key.N, null)));
 			Application.MainLoop.MainIteration ();
@@ -1258,7 +1258,7 @@ Edit
 			Assert.True (menu.ProcessHotKey (new (Key.AltMask | Key.E, new KeyModifiers () { Alt = true })));
 			Assert.True (menu.IsMenuOpen);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (1), output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (1), output);
 
 			Assert.True (Application.Top.Subviews [1].ProcessKey (new (Key.C, null)));
 			Application.MainLoop.MainIteration ();
@@ -1294,19 +1294,19 @@ Edit
 			Assert.True (menu.ProcessHotKey (new (Key.F9, new KeyModifiers ())));
 			Assert.True (menu.IsMenuOpen);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (0), output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (0), output);
 
 			// Open second
 			Assert.True (Application.Top.Subviews [1].ProcessKey (new (Key.CursorRight, null)));
 			Assert.True (menu.IsMenuOpen);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (1), output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (1), output);
 
 			// Close menu
 			Assert.True (menu.ProcessHotKey (new (Key.F9, new KeyModifiers ())));
 			Assert.False (menu.IsMenuOpen);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.ClosedMenuText, output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.ClosedMenuText, output);
 
 			Application.Top.Remove (menu);
 
@@ -1326,19 +1326,19 @@ Edit
 			Assert.True (menu.ProcessHotKey (new (Key.F9, new KeyModifiers ())));
 			Assert.True (menu.IsMenuOpen);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (0), output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (0), output);
 
 			// Open second
 			Assert.True (Application.Top.Subviews [1].ProcessKey (new (Key.CursorRight, null)));
 			Assert.True (menu.IsMenuOpen);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (1), output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (1), output);
 
 			// Close menu
 			Assert.True (menu.ProcessHotKey (new (Key.F9, new KeyModifiers ())));
 			Assert.False (menu.IsMenuOpen);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.ClosedMenuText, output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.ClosedMenuText, output);
 		}
 
 		[Fact, AutoInitShutdown]
@@ -1370,12 +1370,12 @@ Edit
 			Assert.True (menu.IsMenuOpen);
 			Application.Top.Redraw (Application.Top.Bounds);
 
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (0), output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (0), output);
 
 			Assert.True (menu.MouseEvent (new MouseEvent () { X = 1, Y = 0, Flags = MouseFlags.Button1Pressed, View = menu }));
 			Assert.False (menu.IsMenuOpen);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.ClosedMenuText, output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.ClosedMenuText, output);
 		}
 
 		[Fact]
@@ -1432,38 +1432,38 @@ Edit
 			Assert.True (menu.IsMenuOpen);
 			Assert.False (tf.HasFocus);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (0), output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (0), output);
 
 			Assert.True (menu.MouseEvent (new MouseEvent () { X = 8, Y = 0, Flags = MouseFlags.ReportMousePosition, View = menu }));
 			Assert.True (menu.IsMenuOpen);
 			Assert.False (tf.HasFocus);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (1), output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (1), output);
 
 			Assert.True (menu.MouseEvent (new MouseEvent () { X = 15, Y = 0, Flags = MouseFlags.ReportMousePosition, View = menu }));
 			Assert.True (menu.IsMenuOpen);
 			Assert.False (tf.HasFocus);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (2), output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (2), output);
 
 			Assert.True (menu.MouseEvent (new MouseEvent () { X = 8, Y = 0, Flags = MouseFlags.ReportMousePosition, View = menu }));
 			Assert.True (menu.IsMenuOpen);
 			Assert.False (tf.HasFocus);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.ClosedMenuText, output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.ClosedMenuText, output);
 
 			Assert.True (menu.MouseEvent (new MouseEvent () { X = 1, Y = 0, Flags = MouseFlags.ReportMousePosition, View = menu }));
 			Assert.True (menu.IsMenuOpen);
 			Assert.False (tf.HasFocus);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (0), output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (0), output);
 
 
 			Assert.True (menu.MouseEvent (new MouseEvent () { X = 8, Y = 0, Flags = MouseFlags.Button1Pressed, View = menu }));
 			Assert.False (menu.IsMenuOpen);
 			Assert.True (tf.HasFocus);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.ClosedMenuText, output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.ClosedMenuText, output);
 		}
 
 		[Fact, AutoInitShutdown]
@@ -1498,40 +1498,40 @@ Edit
 			Assert.True (menu.IsMenuOpen);
 			Assert.False (tf.HasFocus);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen(0), output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen(0), output);
 
 			// Right - Edit has no sub menu; this tests that no sub menu shows
 			Assert.True (menu.openMenu.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ())));
 			Assert.True (menu.IsMenuOpen);
 			Assert.False (tf.HasFocus);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (1), output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (1), output);
 
 			// Right - Format
 			Assert.True (menu.openMenu.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ())));
 			Assert.True (menu.IsMenuOpen);
 			Assert.False (tf.HasFocus);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (2), output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (2), output);
 
 			// Left - Edit
 			Assert.True (menu.openMenu.ProcessKey (new KeyEvent (Key.CursorLeft, new KeyModifiers ())));
 			Assert.True (menu.IsMenuOpen);
 			Assert.False (tf.HasFocus);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (1), output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (1), output);
 
 			Assert.True (menu.openMenu.ProcessKey (new KeyEvent (Key.CursorLeft, new KeyModifiers ())));
 			Assert.True (menu.IsMenuOpen);
 			Assert.False (tf.HasFocus);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (0), output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.expectedSubMenuOpen (0), output);
 
 			Assert.True (menu.ProcessHotKey (new KeyEvent (Key.F9, new KeyModifiers ())));
 			Assert.False (menu.IsMenuOpen);
 			Assert.True (tf.HasFocus);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsAre (expectedMenu.ClosedMenuText, output);
+			TestHelpers.AssertDriverContentsAre (expectedMenu.ClosedMenuText, output);
 		}
 
 		[Fact, AutoInitShutdown]

+ 6 - 6
UnitTests/MessageBoxTests.cs

@@ -29,7 +29,7 @@ namespace Terminal.Gui.Views {
 
 				} else if (iterations == 1) {
 					Application.Top.Redraw (Application.Top.Bounds);
-					GraphViewTests.AssertDriverContentsWithFrameAre (@"
+					TestHelpers.AssertDriverContentsWithFrameAre (@"
                ┌ Title ─────────────────────────────────────────┐
                │                    Message                     │
                │                                                │
@@ -71,7 +71,7 @@ namespace Terminal.Gui.Views {
 					Application.RequestStop ();
 				} else if (iterations == 1) {
 					Application.Top.Redraw (Application.Top.Bounds);
-					GraphViewTests.AssertDriverContentsWithFrameAre (@"
+					TestHelpers.AssertDriverContentsWithFrameAre (@"
          ┌ About UI Catalog ──────────────────────────────────────────┐
          │             A comprehensive sample library for             │
          │                                                            │
@@ -110,7 +110,7 @@ namespace Terminal.Gui.Views {
 					Application.RequestStop ();
 				} else if (iterations == 1) {
 					Application.Top.Redraw (Application.Top.Bounds);
-					GraphViewTests.AssertDriverContentsWithFrameAre (@"
+					TestHelpers.AssertDriverContentsWithFrameAre (@"
                                     ┌─────┐
                                     │Messa│
                                     │ ge  │
@@ -140,7 +140,7 @@ namespace Terminal.Gui.Views {
 					Application.RequestStop ();
 				} else if (iterations == 1) {
 					Application.Top.Redraw (Application.Top.Bounds);
-					GraphViewTests.AssertDriverContentsWithFrameAre (@"
+					TestHelpers.AssertDriverContentsWithFrameAre (@"
                                   ┌ Title ──┐
                                   │ Message │
                                   │         │
@@ -170,7 +170,7 @@ namespace Terminal.Gui.Views {
 					Application.RequestStop ();
 				} else if (iterations == 1) {
 					Application.Top.Redraw (Application.Top.Bounds);
-					GraphViewTests.AssertDriverContentsWithFrameAre (@"
+					TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌ mywindow ────────────────────────────────────────────────────────────────────┐
 │ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff│
 │ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff│
@@ -224,7 +224,7 @@ namespace Terminal.Gui.Views {
 					Application.RequestStop ();
 				} else if (iterations == 1) {
 					Application.Top.Redraw (Application.Top.Bounds);
-					GraphViewTests.AssertDriverContentsWithFrameAre (@"
+					TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌ mywindow ────────────────────────────────────────────────────────────────────┐
 │ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff │
 │ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff │

+ 2 - 2
UnitTests/PanelViewTests.cs

@@ -405,7 +405,7 @@ namespace Terminal.Gui.Views {
 └──────────────────────────────────────────────────────────────────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 80, 25), pos);
 		}
 
@@ -472,7 +472,7 @@ namespace Terminal.Gui.Views {
 └──────────────────────────────────────────────────────────────────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 80, 25), pos);
 		}
 	}

+ 4 - 4
UnitTests/PosTests.cs

@@ -164,7 +164,7 @@ namespace Terminal.Gui.Core {
 └──────────────────────────────────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 		}
 
 		[Fact]
@@ -211,7 +211,7 @@ namespace Terminal.Gui.Core {
 └──────────────────────────────────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 		}
 
 		[Fact]
@@ -274,7 +274,7 @@ namespace Terminal.Gui.Core {
  F1 Help                                                                        
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 		}
 
 		[Fact]
@@ -337,7 +337,7 @@ namespace Terminal.Gui.Core {
  F1 Help                                                                        
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 		}
 
 		[Fact]

+ 3 - 3
UnitTests/RadioGroupTests.cs

@@ -99,7 +99,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 5), pos);
 
 			rg.DisplayMode = DisplayModeLayout.Horizontal;
@@ -120,7 +120,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 5), pos);
 
 			rg.HorizontalSpace = 4;
@@ -140,7 +140,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 30, 5), pos);
 		}
 

+ 1 - 1
UnitTests/ScenarioTests.cs

@@ -11,7 +11,7 @@ using Xunit.Abstractions;
 // Alias Console to MockConsole so we don't accidentally use Console
 using Console = Terminal.Gui.FakeConsole;
 
-namespace Terminal.Gui {
+namespace UICatalog {
 	public class ScenarioTests {
 		readonly ITestOutputHelper output;
 

+ 10 - 10
UnitTests/ScrollBarViewTests.cs

@@ -737,7 +737,7 @@ namespace Terminal.Gui.Views {
 └───────────────────────────────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 45, 20), pos);
 
 			textView.WordWrap = true;
@@ -774,7 +774,7 @@ namespace Terminal.Gui.Views {
 └────────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 26, 20), pos);
 
 			((FakeDriver)Application.Driver).SetBufferSize (10, 10);
@@ -800,7 +800,7 @@ namespace Terminal.Gui.Views {
 └────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 10, 10), pos);
 		}
 
@@ -824,7 +824,7 @@ namespace Terminal.Gui.Views {
 			Assert.True (sbv.OtherScrollBarView.ShowScrollIndicator);
 			Assert.True (sbv.Visible);
 			Assert.True (sbv.OtherScrollBarView.Visible);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is a tes▲
 This is a tes┬
 This is a tes┴
@@ -842,7 +842,7 @@ This is a tes▼
 			Assert.False (sbv.Visible);
 			Assert.False (sbv.OtherScrollBarView.Visible);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is a test
 This is a test
 This is a test
@@ -860,7 +860,7 @@ This is a test
 			Assert.True (sbv.Visible);
 			Assert.True (sbv.OtherScrollBarView.Visible);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is a tes▲
 This is a tes┬
 This is a tes┴
@@ -887,7 +887,7 @@ This is a tes▼
 			Assert.Null (sbv.OtherScrollBarView);
 			Assert.True (sbv.ShowScrollIndicator);
 			Assert.True (sbv.Visible);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is a tes▲
 This is a tes┬
 This is a tes┴
@@ -901,7 +901,7 @@ This is a tes▼
 			Assert.False (sbv.ShowScrollIndicator);
 			Assert.False (sbv.Visible);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is a test
 This is a test
 This is a test
@@ -930,7 +930,7 @@ This is a test
 			Assert.Null (sbv.OtherScrollBarView);
 			Assert.False (sbv.ShowScrollIndicator);
 			Assert.False (sbv.Visible);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is a test[ Click Me! ]
 This is a test             
 This is a test             
@@ -957,7 +957,7 @@ This is a test
 			Assert.False (sbv.ShowScrollIndicator);
 			Assert.True (sbv.Visible);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is a test[ Click Me! ]
 This is a test             
 This is a test             

+ 4 - 4
UnitTests/ScrollViewTests.cs

@@ -196,13 +196,13 @@ namespace Terminal.Gui.Views {
 			Assert.True (sv.AutoHideScrollBars);
 			Assert.False (sv.ShowHorizontalScrollIndicator);
 			Assert.False (sv.ShowVerticalScrollIndicator);
-			GraphViewTests.AssertDriverContentsWithFrameAre ("", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ("", output);
 
 			sv.AutoHideScrollBars = false;
 			sv.ShowHorizontalScrollIndicator = true;
 			sv.ShowVerticalScrollIndicator = true;
 			sv.Redraw (sv.Bounds);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
@@ -233,7 +233,7 @@ namespace Terminal.Gui.Views {
 			Assert.True (sv.AutoHideScrollBars);
 			Assert.True (sv.ShowHorizontalScrollIndicator);
 			Assert.True (sv.ShowVerticalScrollIndicator);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
@@ -267,7 +267,7 @@ namespace Terminal.Gui.Views {
 			Assert.True (sv.AutoHideScrollBars);
 			Assert.True (sv.ShowHorizontalScrollIndicator);
 			Assert.True (sv.ShowVerticalScrollIndicator);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"

+ 2 - 2
UnitTests/StatusBarTests.cs

@@ -113,7 +113,7 @@ namespace Terminal.Gui.Views {
 ^O Open {Application.Driver.VLine} ^Q Quit
 ";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			sb = new StatusBar (new StatusItem [] {
 				new StatusItem (Key.CtrlMask | Key.Q, "~CTRL-O~ Open", null),
@@ -125,7 +125,7 @@ namespace Terminal.Gui.Views {
 CTRL-O Open {Application.Driver.VLine} CTRL-Q Quit
 ";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 		}
 
 		[Fact]

+ 31 - 31
UnitTests/TabViewTests.cs

@@ -257,7 +257,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──┐      
 │12│13    
 │  └─────┐
@@ -268,7 +268,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
    ┌──┐   
  12│13│   
 ┌──┘  └──┐
@@ -282,7 +282,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌───────┐ 
 │1234567│ 
 │       └►
@@ -293,7 +293,7 @@ namespace Terminal.Gui.Views {
 			tv.SelectedTab = tab2;
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──┐      
 │13│      
 ◄  └─────┐
@@ -307,7 +307,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌───────┐ 
 │abcdefg│ 
 ◄       └┐
@@ -333,7 +333,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 │12│13    
 │  └─────┐
 │hi      │
@@ -345,7 +345,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
  12│13│   
 ┌──┘  └──┐
 │hi2     │
@@ -360,7 +360,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 │1234567│ 
 │       └►
 │hi      │
@@ -371,7 +371,7 @@ namespace Terminal.Gui.Views {
 			tv.SelectedTab = tab2;
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 │13│      
 ◄  └─────┐
 │hi2     │
@@ -385,7 +385,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 │abcdefg│ 
 ◄       └┐
 │hi2     │
@@ -403,7 +403,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌─┐ 
 │T│ 
 │ └►
@@ -423,7 +423,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 │T│ 
 │ └►
 │hi│
@@ -441,7 +441,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌┐ 
 ││ 
 │└►
@@ -461,7 +461,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ││ 
 │└►
 │h│
@@ -487,7 +487,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌────────┐
 │hi      │
 │  ┌─────┘
@@ -501,7 +501,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌────────┐
 │hi      │
 │       ┌►
@@ -512,7 +512,7 @@ namespace Terminal.Gui.Views {
 			tv.SelectedTab = tab2;
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌────────┐
 │hi2     │
 ◄  ┌─────┘
@@ -526,7 +526,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌────────┐
 │hi2     │
 ◄       ┌┘
@@ -552,7 +552,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌────────┐
 │hi      │
 │        │
@@ -564,7 +564,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌────────┐
 │hi2     │
 │        │
@@ -579,7 +579,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌────────┐
 │hi      │
 │        │
@@ -590,7 +590,7 @@ namespace Terminal.Gui.Views {
 			tv.SelectedTab = tab2;
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌────────┐
 │hi2     │
 │        │
@@ -604,7 +604,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌────────┐
 │hi2     │
 │        │
@@ -624,7 +624,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──┐
 │hi│
 │ ┌►
@@ -644,7 +644,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──┐
 │hi│
 │  │
@@ -664,7 +664,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌─┐
 │h│
 │┌►
@@ -684,7 +684,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌─┐
 │h│
 │ │
@@ -706,7 +706,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌────┐              
 │Tab0│              
 │    └─────────────►
@@ -717,7 +717,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──────────────┐    
 │Les Misérables│    
 ◄              └───┐
@@ -741,7 +741,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──────────────────┐
 │hi                │
 │    ┌─────────────►
@@ -752,7 +752,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌──────────────────┐
 │hi2               │
 ◄              ┌───┘

+ 28 - 28
UnitTests/TableViewTests.cs

@@ -459,7 +459,7 @@ namespace Terminal.Gui.Views {
 ├─┼──────┤
 │1│2     │
 ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			// Shutdown must be called to safely clean up Application if Init has been called
 			Application.Shutdown ();
@@ -482,7 +482,7 @@ namespace Terminal.Gui.Views {
 ├─┼─┼────┤
 │1│2│    │
 ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			// Shutdown must be called to safely clean up Application if Init has been called
 			Application.Shutdown ();
@@ -506,7 +506,7 @@ namespace Terminal.Gui.Views {
 ├─┼─┤
 │1│2│
 ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			// Shutdown must be called to safely clean up Application if Init has been called
 			Application.Shutdown ();
@@ -670,7 +670,7 @@ namespace Terminal.Gui.Views {
 ├─┼─┤
 │1│2│
 ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			string expectedColors = @"
@@ -680,7 +680,7 @@ namespace Terminal.Gui.Views {
 01000
 ";
 			
-			GraphViewTests.AssertDriverColorsAre (expectedColors, new Attribute [] {
+			TestHelpers.AssertDriverColorsAre (expectedColors, new Attribute [] {
 				// 0
 				tv.ColorScheme.Normal,				
 				// 1
@@ -714,7 +714,7 @@ namespace Terminal.Gui.Views {
 ├─┼─┤
 │1│2│
 ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			string expectedColors = @"
@@ -727,7 +727,7 @@ namespace Terminal.Gui.Views {
 			var invertHotFocus = new Attribute(tv.ColorScheme.HotFocus.Background,tv.ColorScheme.HotFocus.Foreground);
 			var invertHotNormal = new Attribute(tv.ColorScheme.HotNormal.Background,tv.ColorScheme.HotNormal.Foreground);
 
-			GraphViewTests.AssertDriverColorsAre (expectedColors, new Attribute [] {
+			TestHelpers.AssertDriverColorsAre (expectedColors, new Attribute [] {
 				// 0
 				tv.ColorScheme.Normal,				
 				// 1
@@ -771,7 +771,7 @@ namespace Terminal.Gui.Views {
 ├─┼─┤
 │1│2│
 ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			string expectedColors = @"
@@ -781,7 +781,7 @@ namespace Terminal.Gui.Views {
 21222
 ";
 			
-			GraphViewTests.AssertDriverColorsAre (expectedColors, new Attribute [] {
+			TestHelpers.AssertDriverColorsAre (expectedColors, new Attribute [] {
 				// 0
 				tv.ColorScheme.Normal,				
 				// 1
@@ -803,7 +803,7 @@ namespace Terminal.Gui.Views {
 ├─┼─┤
 │1│5│
 ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			expectedColors = @"
@@ -816,7 +816,7 @@ namespace Terminal.Gui.Views {
 			// now we only see 2 colors used (the selected cell color and Normal
 			// rowHighlight should no longer be used because the delegate returned null
 			// (now that the cell value is 5 - which does not match the conditional)
-			GraphViewTests.AssertDriverColorsAre (expectedColors, new Attribute [] {
+			TestHelpers.AssertDriverColorsAre (expectedColors, new Attribute [] {
 				// 0
 				tv.ColorScheme.Normal,
 				// 1
@@ -864,7 +864,7 @@ namespace Terminal.Gui.Views {
 ├─┼─┤
 │1│2│
 ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			string expectedColors = @"
@@ -874,7 +874,7 @@ namespace Terminal.Gui.Views {
 01020
 ";
 			
-			GraphViewTests.AssertDriverColorsAre (expectedColors, new Attribute [] {
+			TestHelpers.AssertDriverColorsAre (expectedColors, new Attribute [] {
 				// 0
 				tv.ColorScheme.Normal,				
 				// 1
@@ -896,7 +896,7 @@ namespace Terminal.Gui.Views {
 ├─┼─┤
 │1│5│
 ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			expectedColors = @"
@@ -909,7 +909,7 @@ namespace Terminal.Gui.Views {
 			// now we only see 2 colors used (the selected cell color and Normal
 			// cellHighlight should no longer be used because the delegate returned null
 			// (now that the cell value is 5 - which does not match the conditional)
-			GraphViewTests.AssertDriverColorsAre (expectedColors, new Attribute [] {
+			TestHelpers.AssertDriverColorsAre (expectedColors, new Attribute [] {
 				// 0
 				tv.ColorScheme.Normal,				
 				// 1
@@ -1005,7 +1005,7 @@ namespace Terminal.Gui.Views {
 │A│B│C│
 │1│2│3│";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			// Scroll right
@@ -1026,7 +1026,7 @@ namespace Terminal.Gui.Views {
 │B│C│D│
 │2│3│4│";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			// Shutdown must be called to safely clean up Application if Init has been called
@@ -1070,7 +1070,7 @@ namespace Terminal.Gui.Views {
 │A│B│C│
 │1│2│3│";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			// Scroll right
@@ -1091,7 +1091,7 @@ namespace Terminal.Gui.Views {
 │D│E│F│
 │4│5│6│";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			// Shutdown must be called to safely clean up Application if Init has been called
@@ -1135,7 +1135,7 @@ namespace Terminal.Gui.Views {
 │1│2                    │
 ";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			// get a style for the long column
 			var style = tableView.Style.GetOrCreateColumnStyle(dt.Columns[2]);
@@ -1152,7 +1152,7 @@ namespace Terminal.Gui.Views {
 │1│2│aaaaaaaaaa         │
 │1│2│aaa                │
 ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			// revert the style change
 			style.MaxWidth = TableView.DefaultMaxCellWidth;
@@ -1172,7 +1172,7 @@ namespace Terminal.Gui.Views {
 │1│2│aaaaaaaaaaaaa...   │
 │1│2│aaa                │
 ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			// revert style change
 			style.RepresentationGetter = null;
@@ -1197,7 +1197,7 @@ namespace Terminal.Gui.Views {
 │1│2│aaaaaaaaaaaaaaaaaaa│
 │1│2│aaa                │
 ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			// Now test making the width too small for the MinAcceptableWidth
 			// the Column won't fit so should not be rendered
@@ -1214,7 +1214,7 @@ namespace Terminal.Gui.Views {
 │1│2    │
 
 ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			// setting width to 10 leaves just enough space for the column to
 			// meet MinAcceptableWidth of 5.  Column width includes terminator line
@@ -1228,7 +1228,7 @@ namespace Terminal.Gui.Views {
 │1│2│aaaa│
 │1│2│aaa │
 ";
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			Application.Shutdown ();
 		}
@@ -1274,7 +1274,7 @@ namespace Terminal.Gui.Views {
 ├─┼─┼─►
 │1│2│3│";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			// Scroll right
@@ -1291,7 +1291,7 @@ namespace Terminal.Gui.Views {
 ◄─┼─┼─►
 │2│3│4│";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 
 			// Scroll right twice more (to end of columns)
@@ -1306,7 +1306,7 @@ namespace Terminal.Gui.Views {
 ◄─┼─┼─┤
 │4│5│6│";
 
-			GraphViewTests.AssertDriverContentsAre (expected, output);
+			TestHelpers.AssertDriverContentsAre (expected, output);
 
 			// Shutdown must be called to safely clean up Application if Init has been called
 			Application.Shutdown ();

+ 230 - 0
UnitTests/TestHelpers.cs

@@ -0,0 +1,230 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Xunit.Abstractions;
+using Xunit;
+using Terminal.Gui;
+using Rune = System.Rune;
+using Attribute = Terminal.Gui.Attribute;
+using System.Text.RegularExpressions;
+using System.Reflection;
+
+
+// This class enables test functions annotated with the [AutoInitShutdown] attribute to 
+// automatically call Application.Init before called and Application.Shutdown after
+// 
+// This is necessary because a) Application is a singleton and Init/Shutdown must be called
+// as a pair, and b) all unit test functions should be atomic.
+[AttributeUsage (AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
+public class AutoInitShutdownAttribute : Xunit.Sdk.BeforeAfterTestAttribute {
+
+	static bool _init = false;
+	public override void Before (MethodInfo methodUnderTest)
+	{
+		if (_init) {
+			throw new InvalidOperationException ("After did not run.");
+		}
+
+		Application.Init (new FakeDriver (), new FakeMainLoop (() => FakeConsole.ReadKey (true)));
+		_init = true;
+	}
+
+	public override void After (MethodInfo methodUnderTest)
+	{
+		Application.Shutdown ();
+		_init = false;
+	}
+}
+
+class TestHelpers {
+
+
+#pragma warning disable xUnit1013 // Public method should be marked as test
+	public static void AssertDriverContentsAre (string expectedLook, ITestOutputHelper output)
+	{
+#pragma warning restore xUnit1013 // Public method should be marked as test
+
+		var sb = new StringBuilder ();
+		var driver = ((FakeDriver)Application.Driver);
+
+		var contents = driver.Contents;
+
+		for (int r = 0; r < driver.Rows; r++) {
+			for (int c = 0; c < driver.Cols; c++) {
+				sb.Append ((char)contents [r, c, 0]);
+			}
+			sb.AppendLine ();
+		}
+
+		var actualLook = sb.ToString ();
+
+		if (!string.Equals (expectedLook, actualLook)) {
+
+			// ignore trailing whitespace on each line
+			var trailingWhitespace = new Regex (@"\s+$", RegexOptions.Multiline);
+
+			// get rid of trailing whitespace on each line (and leading/trailing whitespace of start/end of full string)
+			expectedLook = trailingWhitespace.Replace (expectedLook, "").Trim ();
+			actualLook = trailingWhitespace.Replace (actualLook, "").Trim ();
+
+			// standardize line endings for the comparison
+			expectedLook = expectedLook.Replace ("\r\n", "\n");
+			actualLook = actualLook.Replace ("\r\n", "\n");
+
+			output?.WriteLine ("Expected:" + Environment.NewLine + expectedLook);
+			output?.WriteLine ("But Was:" + Environment.NewLine + actualLook);
+
+			Assert.Equal (expectedLook, actualLook);
+		}
+	}
+
+	public static Rect AssertDriverContentsWithFrameAre (string expectedLook, ITestOutputHelper output)
+	{
+		var lines = new List<List<char>> ();
+		var sb = new StringBuilder ();
+		var driver = ((FakeDriver)Application.Driver);
+		var x = -1;
+		var y = -1;
+		int w = -1;
+		int h = -1;
+
+		var contents = driver.Contents;
+
+		for (int r = 0; r < driver.Rows; r++) {
+			var runes = new List<char> ();
+			for (int c = 0; c < driver.Cols; c++) {
+				var rune = (char)contents [r, c, 0];
+				if (rune != ' ') {
+					if (x == -1) {
+						x = c;
+						y = r;
+						for (int i = 0; i < c; i++) {
+							runes.InsertRange (i, new List<char> () { ' ' });
+						}
+					}
+					if (Rune.ColumnWidth (rune) > 1) {
+						c++;
+					}
+					if (c + 1 > w) {
+						w = c + 1;
+					}
+					h = r - y + 1;
+				}
+				if (x > -1) {
+					runes.Add (rune);
+				}
+			}
+			if (runes.Count > 0) {
+				lines.Add (runes);
+			}
+		}
+
+		// Remove unnecessary empty lines
+		if (lines.Count > 0) {
+			for (int r = lines.Count - 1; r > h - 1; r--) {
+				lines.RemoveAt (r);
+			}
+		}
+
+		// Remove trailing whitespace on each line
+		for (int r = 0; r < lines.Count; r++) {
+			List<char> row = lines [r];
+			for (int c = row.Count - 1; c >= 0; c--) {
+				var rune = row [c];
+				if (rune != ' ' || (row.Sum (x => Rune.ColumnWidth (x)) == w)) {
+					break;
+				}
+				row.RemoveAt (c);
+			}
+		}
+
+		// Convert char list to string
+		for (int r = 0; r < lines.Count; r++) {
+			var line = new string (lines [r].ToArray ());
+			if (r == lines.Count - 1) {
+				sb.Append (line);
+			} else {
+				sb.AppendLine (line);
+			}
+		}
+
+		var actualLook = sb.ToString ();
+
+		if (!string.Equals (expectedLook, actualLook)) {
+
+			// standardize line endings for the comparison
+			expectedLook = expectedLook.Replace ("\r\n", "\n");
+			actualLook = actualLook.Replace ("\r\n", "\n");
+
+			// Remove the first and the last line ending from the expectedLook
+			if (expectedLook.StartsWith ("\n")) {
+				expectedLook = expectedLook [1..];
+			}
+			if (expectedLook.EndsWith ("\n")) {
+				expectedLook = expectedLook [..^1];
+			}
+
+			output?.WriteLine ("Expected:" + Environment.NewLine + expectedLook);
+			output?.WriteLine ("But Was:" + Environment.NewLine + actualLook);
+
+			Assert.Equal (expectedLook, actualLook);
+		}
+		return new Rect (x > -1 ? x : 0, y > -1 ? y : 0, w > -1 ? w : 0, h > -1 ? h : 0);
+	}
+
+#pragma warning disable xUnit1013 // Public method should be marked as test
+	/// <summary>
+	/// Verifies the console was rendered using the given <paramref name="expectedColors"/> at the given locations.
+	/// Pass a bitmap of indexes into <paramref name="expectedColors"/> as <paramref name="expectedLook"/> and the
+	/// test method will verify those colors were used in the row/col of the console during rendering
+	/// </summary>
+	/// <param name="expectedLook">Numbers between 0 and 9 for each row/col of the console.  Must be valid indexes of <paramref name="expectedColors"/></param>
+	/// <param name="expectedColors"></param>
+	public static void AssertDriverColorsAre (string expectedLook, Attribute [] expectedColors)
+	{
+#pragma warning restore xUnit1013 // Public method should be marked as test
+
+		if (expectedColors.Length > 10) {
+			throw new ArgumentException ("This method only works for UIs that use at most 10 colors");
+		}
+
+		expectedLook = expectedLook.Trim ();
+		var driver = ((FakeDriver)Application.Driver);
+
+		var contents = driver.Contents;
+
+		int r = 0;
+		foreach (var line in expectedLook.Split ('\n').Select (l => l.Trim ())) {
+
+			for (int c = 0; c < line.Length; c++) {
+
+				int val = contents [r, c, 1];
+
+				var match = expectedColors.Where (e => e.Value == val).ToList ();
+				if (match.Count == 0) {
+					throw new Exception ($"Unexpected color {DescribeColor (val)} was used at row {r} and col {c} (indexes start at 0).  Color value was {val} (expected colors were {string.Join (",", expectedColors.Select (c => c.Value))})");
+				} else if (match.Count > 1) {
+					throw new ArgumentException ($"Bad value for expectedColors, {match.Count} Attributes had the same Value");
+				}
+
+				var colorUsed = Array.IndexOf (expectedColors, match [0]).ToString () [0];
+				var userExpected = line [c];
+
+				if (colorUsed != userExpected) {
+					throw new Exception ($"Colors used did not match expected at row {r} and col {c} (indexes start at 0).  Color index used was {DescribeColor (colorUsed)} but test expected {DescribeColor (userExpected)} (these are indexes into the expectedColors array)");
+				}
+			}
+
+			r++;
+		}
+	}
+
+	private static object DescribeColor (int userExpected)
+	{
+		var a = new Attribute (userExpected);
+		return $"{a.Foreground},{a.Background}";
+	}
+}
+

+ 35 - 35
UnitTests/TextFormatterTests.cs

@@ -2190,7 +2190,7 @@ namespace Terminal.Gui.Core {
 └───┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, width + 2, height + 2), pos);
 		}
 
@@ -2229,7 +2229,7 @@ namespace Terminal.Gui.Core {
 └────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, width + 2, height + 2), pos);
 		}
 
@@ -2270,7 +2270,7 @@ namespace Terminal.Gui.Core {
 └──────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, width + 2, height + 2), pos);
 		}
 
@@ -2310,7 +2310,7 @@ namespace Terminal.Gui.Core {
 └────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, width + 2, height + 2), pos);
 		}
 
@@ -3059,7 +3059,7 @@ namespace Terminal.Gui.Core {
 Demo Simple Rune
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 16, 1), pos);
 		}
 
@@ -3096,7 +3096,7 @@ n
 e
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 1, 16), pos);
 		}
 
@@ -3114,7 +3114,7 @@ e
 デモエムポンズ
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 14, 1), pos);
 		}
 
@@ -3140,7 +3140,7 @@ e
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 2, 7), pos);
 		}
 
@@ -3169,7 +3169,7 @@ e
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 2, 7), pos);
 		}
 
@@ -3208,7 +3208,7 @@ e
 └────────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, width + 2, 6), pos);
 		}
 
@@ -3263,7 +3263,7 @@ e
 └───────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 9, height + 2), pos);
 		}
 
@@ -3302,7 +3302,7 @@ e
 └─────────────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, width + 2, 6), pos);
 		}
 
@@ -3361,7 +3361,7 @@ e
 └───────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 13, height + 2), pos);
 		}
 
@@ -3385,7 +3385,7 @@ e
 
 			tf2.Draw (new Rect (new Point (0, 2), tf2Size), view.GetNormalColor (), view.ColorScheme.HotNormal);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This view needs to be cleared before rewritten.                        
 This TextFormatter (tf1) without fill will not be cleared on rewritten.
 This TextFormatter (tf2) with fill will be cleared on rewritten.       
@@ -3400,7 +3400,7 @@ This TextFormatter (tf2) with fill will be cleared on rewritten.
 			tf2.Text = "This TextFormatter (tf2) is rewritten.";
 			tf2.Draw (new Rect (new Point (0, 2), tf2Size), view.GetNormalColor (), view.ColorScheme.HotNormal);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This view is rewritten.                                                
 This TextFormatter (tf1) is rewritten.will not be cleared on rewritten.
 This TextFormatter (tf2) is rewritten.                                 
@@ -3502,7 +3502,7 @@ This TextFormatter (tf2) is rewritten.
 └────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 10, 4), pos);
 
 			text = "0123456789";
@@ -3520,7 +3520,7 @@ This TextFormatter (tf2) is rewritten.
 └────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 10, 4), pos);
 		}
 
@@ -3555,7 +3555,7 @@ This TextFormatter (tf2) is rewritten.
 └────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 10, 4), pos);
 
 			text = "0123456789";
@@ -3574,7 +3574,7 @@ This TextFormatter (tf2) is rewritten.
 └────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 10, 4), pos);
 		}
 
@@ -3610,7 +3610,7 @@ This TextFormatter (tf2) is rewritten.
 └────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 10, 4), pos);
 
 			text = "0123456789";
@@ -3629,7 +3629,7 @@ This TextFormatter (tf2) is rewritten.
 └────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 10, 4), pos);
 		}
 
@@ -3666,7 +3666,7 @@ This TextFormatter (tf2) is rewritten.
 └────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 10, 4), pos);
 
 			text = "0123456789";
@@ -3685,7 +3685,7 @@ This TextFormatter (tf2) is rewritten.
 └────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 10, 4), pos);
 		}
 
@@ -3720,7 +3720,7 @@ This TextFormatter (tf2) is rewritten.
 └────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 10, 4), pos);
 
 			text = "0123456789";
@@ -3739,7 +3739,7 @@ This TextFormatter (tf2) is rewritten.
 └────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 10, 4), pos);
 		}
 
@@ -3775,7 +3775,7 @@ This TextFormatter (tf2) is rewritten.
 └────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 10, 4), pos);
 
 			text = "0123456789";
@@ -3794,7 +3794,7 @@ This TextFormatter (tf2) is rewritten.
 └────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 10, 4), pos);
 		}
 
@@ -3837,7 +3837,7 @@ This TextFormatter (tf2) is rewritten.
 └──┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 4, 10), pos);
 
 			text = "0123456789";
@@ -3862,7 +3862,7 @@ This TextFormatter (tf2) is rewritten.
 └──┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 4, 10), pos);
 		}
 
@@ -3904,7 +3904,7 @@ This TextFormatter (tf2) is rewritten.
 └──┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 4, 10), pos);
 
 			text = "0123456789";
@@ -3929,7 +3929,7 @@ This TextFormatter (tf2) is rewritten.
 └──┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 4, 10), pos);
 		}
 
@@ -3972,7 +3972,7 @@ This TextFormatter (tf2) is rewritten.
 └──┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 4, 10), pos);
 
 			text = "0123456789";
@@ -3997,7 +3997,7 @@ This TextFormatter (tf2) is rewritten.
 └──┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 4, 10), pos);
 		}
 
@@ -4039,7 +4039,7 @@ This TextFormatter (tf2) is rewritten.
 └──┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 4, 10), pos);
 
 			text = "0123456789";
@@ -4064,7 +4064,7 @@ This TextFormatter (tf2) is rewritten.
 └──┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 4, 10), pos);
 		}
 

+ 35 - 35
UnitTests/TextViewTests.cs

@@ -1973,7 +1973,7 @@ namespace Terminal.Gui.Views {
 
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is
 the    
 first  
@@ -2000,7 +2000,7 @@ line.
 
 			Assert.Equal (new Point (0, 0), tv.CursorPosition);
 			Assert.Equal (0, tv.LeftColumn);
-			GraphViewTests.AssertDriverContentsAre (@"
+			TestHelpers.AssertDriverContentsAre (@"
 aaaa
 ", output);
 
@@ -2008,35 +2008,35 @@ aaaa
 			Assert.True (tv.ProcessKey (new KeyEvent (Key.Backspace, new KeyModifiers ())));
 			Application.Refresh ();
 			Assert.Equal (0, tv.LeftColumn);
-			GraphViewTests.AssertDriverContentsAre (@"
+			TestHelpers.AssertDriverContentsAre (@"
 aaa
 ", output);
 
 			Assert.True (tv.ProcessKey (new KeyEvent (Key.Backspace, new KeyModifiers ())));
 			Application.Refresh ();
 			Assert.Equal (0, tv.LeftColumn);
-			GraphViewTests.AssertDriverContentsAre (@"
+			TestHelpers.AssertDriverContentsAre (@"
 aa
 ", output);
 
 			Assert.True (tv.ProcessKey (new KeyEvent (Key.Backspace, new KeyModifiers ())));
 			Application.Refresh ();
 			Assert.Equal (0, tv.LeftColumn);
-			GraphViewTests.AssertDriverContentsAre (@"
+			TestHelpers.AssertDriverContentsAre (@"
 a
 ", output);
 
 			Assert.True (tv.ProcessKey (new KeyEvent (Key.Backspace, new KeyModifiers ())));
 			Application.Refresh ();
 			Assert.Equal (0, tv.LeftColumn);
-			GraphViewTests.AssertDriverContentsAre (@"
+			TestHelpers.AssertDriverContentsAre (@"
 
 ", output);
 
 			Assert.True (tv.ProcessKey (new KeyEvent (Key.Backspace, new KeyModifiers ())));
 			Application.Refresh ();
 			Assert.Equal (0, tv.LeftColumn);
-			GraphViewTests.AssertDriverContentsAre (@"
+			TestHelpers.AssertDriverContentsAre (@"
 
 ", output);
 		}
@@ -2055,7 +2055,7 @@ a
 			Application.Top.Add (tv);
 
 			tv.Redraw (tv.Bounds);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is  
 the first
 line.    
@@ -2069,7 +2069,7 @@ line.
 			tv.CursorPosition = new Point (6, 2);
 			Assert.Equal (new Point (5, 2), tv.CursorPosition);
 			tv.Redraw (tv.Bounds);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is  
 the first
 line.    
@@ -5953,7 +5953,7 @@ line.
 			Assert.False (tv.WordWrap);
 			Assert.Equal (Point.Empty, tv.CursorPosition);
 			Assert.Equal (Point.Empty, cp);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is the first line. 
 This is the second line.
 ", output);
@@ -5963,7 +5963,7 @@ This is the second line.
 			tv.Redraw (tv.Bounds);
 			Assert.Equal (new Point (12, 0), tv.CursorPosition);
 			Assert.Equal (new Point (12, 0), cp);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is the first line. 
 This is the second line.
 ", output);
@@ -5972,7 +5972,7 @@ This is the second line.
 			tv.Redraw (tv.Bounds);
 			Assert.Equal (new Point (4, 2), tv.CursorPosition);
 			Assert.Equal (new Point (12, 0), cp);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This 
 is   
 the  
@@ -5991,7 +5991,7 @@ line.
 			tv.Redraw (tv.Bounds);
 			Assert.Equal (new Point (0, 3), tv.CursorPosition);
 			Assert.Equal (new Point (12, 0), cp);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This 
 is   
 the  
@@ -6010,7 +6010,7 @@ line.
 			tv.Redraw (tv.Bounds);
 			Assert.Equal (new Point (1, 3), tv.CursorPosition);
 			Assert.Equal (new Point (13, 0), cp);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This 
 is   
 the  
@@ -6029,7 +6029,7 @@ line.
 			tv.Redraw (tv.Bounds);
 			Assert.Equal (new Point (0, 3), tv.CursorPosition);
 			Assert.Equal (new Point (12, 0), cp);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This 
 is   
 the  
@@ -6061,7 +6061,7 @@ line.
 
 			Assert.False (tv.WordWrap);
 			Assert.Equal (Point.Empty, tv.CursorPosition);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is the first line. 
 This is the second line.
 ", output);
@@ -6071,7 +6071,7 @@ This is the second line.
 			Assert.True (tv.ProcessKey (new KeyEvent (Key.Backspace, new KeyModifiers ())));
 			tv.Redraw (tv.Bounds);
 			Assert.Equal (new Point (2, 0), tv.CursorPosition);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 Ths is the first line.  
 This is the second line.
 ", output);
@@ -6081,14 +6081,14 @@ This is the second line.
 			Assert.True (tv.ProcessKey (new KeyEvent (Key.Backspace, new KeyModifiers ())));
 			tv.Redraw (tv.Bounds);
 			Assert.Equal (new Point (22, 0), tv.CursorPosition);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 Ths is the first line.This is the second line.
 ", output);
 
 			Assert.True (tv.ProcessKey (new KeyEvent (Key.Enter, new KeyModifiers ())));
 			tv.Redraw (tv.Bounds);
 			Assert.Equal (new Point (0, 1), tv.CursorPosition);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 Ths is the first line.  
 This is the second line.
 ", output);
@@ -6118,7 +6118,7 @@ This is the second line.
 
 			Assert.True (tv.WordWrap);
 			Assert.Equal (Point.Empty, tv.CursorPosition);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is the first line. 
 This is the second line.
 ", output);
@@ -6128,7 +6128,7 @@ This is the second line.
 			Assert.True (tv.ProcessKey (new KeyEvent (Key.Backspace, new KeyModifiers ())));
 			tv.Redraw (tv.Bounds);
 			Assert.Equal (new Point (2, 0), tv.CursorPosition);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 Ths is the first line.  
 This is the second line.
 ", output);
@@ -6138,14 +6138,14 @@ This is the second line.
 			Assert.True (tv.ProcessKey (new KeyEvent (Key.Backspace, new KeyModifiers ())));
 			tv.Redraw (tv.Bounds);
 			Assert.Equal (new Point (22, 0), tv.CursorPosition);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 Ths is the first line.This is the second line.
 ", output);
 
 			Assert.True (tv.ProcessKey (new KeyEvent (Key.Enter, new KeyModifiers ())));
 			tv.Redraw (tv.Bounds);
 			Assert.Equal (new Point (0, 1), tv.CursorPosition);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 Ths is the first line.  
 This is the second line.
 ", output);
@@ -6174,7 +6174,7 @@ This is the second line.
 
 			Assert.False (tv.WordWrap);
 			Assert.Equal (Point.Empty, tv.CursorPosition);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is the first line. 
 This is the second line.
 ", output);
@@ -6184,7 +6184,7 @@ This is the second line.
 			Assert.True (tv.ProcessKey (new KeyEvent (Key.DeleteChar, new KeyModifiers ())));
 			tv.Redraw (tv.Bounds);
 			Assert.Equal (new Point (2, 0), tv.CursorPosition);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 Ths is the first line.  
 This is the second line.
 ", output);
@@ -6194,14 +6194,14 @@ This is the second line.
 			Assert.True (tv.ProcessKey (new KeyEvent (Key.DeleteChar, new KeyModifiers ())));
 			tv.Redraw (tv.Bounds);
 			Assert.Equal (new Point (22, 0), tv.CursorPosition);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 Ths is the first line.This is the second line.
 ", output);
 
 			Assert.True (tv.ProcessKey (new KeyEvent (Key.Enter, new KeyModifiers ())));
 			tv.Redraw (tv.Bounds);
 			Assert.Equal (new Point (0, 1), tv.CursorPosition);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 Ths is the first line.  
 This is the second line.
 ", output);
@@ -6231,7 +6231,7 @@ This is the second line.
 
 			Assert.True (tv.WordWrap);
 			Assert.Equal (Point.Empty, tv.CursorPosition);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is the first line. 
 This is the second line.
 ", output);
@@ -6241,7 +6241,7 @@ This is the second line.
 			Assert.True (tv.ProcessKey (new KeyEvent (Key.DeleteChar, new KeyModifiers ())));
 			tv.Redraw (tv.Bounds);
 			Assert.Equal (new Point (2, 0), tv.CursorPosition);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 Ths is the first line.  
 This is the second line.
 ", output);
@@ -6251,14 +6251,14 @@ This is the second line.
 			Assert.True (tv.ProcessKey (new KeyEvent (Key.DeleteChar, new KeyModifiers ())));
 			tv.Redraw (tv.Bounds);
 			Assert.Equal (new Point (22, 0), tv.CursorPosition);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 Ths is the first line.This is the second line.
 ", output);
 
 			Assert.True (tv.ProcessKey (new KeyEvent (Key.Enter, new KeyModifiers ())));
 			tv.Redraw (tv.Bounds);
 			Assert.Equal (new Point (0, 1), tv.CursorPosition);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 Ths is the first line.  
 This is the second line.
 ", output);
@@ -6295,7 +6295,7 @@ This is the second line.
 			((FakeDriver)Application.Driver).SetBufferSize (15, 15);
 			Application.Refresh ();
 			//this passes
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (
 			@"
 ┌─────────────┐
 │             │
@@ -6321,7 +6321,7 @@ This is the second line.
 			tv.InsertText ("\naaa\nbbb");
 			Application.Refresh ();
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (
+			TestHelpers.AssertDriverContentsWithFrameAre (
 			@"
 ┌─────────────┐
 │             │
@@ -6365,7 +6365,7 @@ This is the second line.
 			Application.Refresh ();
 
 			//this passes
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (
 			@"
 ┌─────────────┐
 │             │
@@ -6391,7 +6391,7 @@ This is the second line.
 			tv.InsertText ("\r\naaa\r\nbbb");
 			Application.Refresh ();
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (
+			TestHelpers.AssertDriverContentsWithFrameAre (
 			@"
 ┌─────────────┐
 │             │

+ 9 - 9
UnitTests/TreeViewTests.cs

@@ -748,7 +748,7 @@ namespace Terminal.Gui.Views {
 			tv.ColorScheme = new ColorScheme ();
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsAre (
+			TestHelpers.AssertDriverContentsAre (
 @"├-normal
 │ ├─pink
 │ └─normal
@@ -766,7 +766,7 @@ namespace Terminal.Gui.Views {
 			tv.Redraw (tv.Bounds);
 
 
-			GraphViewTests.AssertDriverContentsAre (
+			TestHelpers.AssertDriverContentsAre (
 @"├+normal
 └─pink
 ", output);
@@ -797,7 +797,7 @@ namespace Terminal.Gui.Views {
 			tv.ColorScheme = new ColorScheme ();
 			tv.Redraw (tv.Bounds);
 
-			GraphViewTests.AssertDriverContentsAre (
+			TestHelpers.AssertDriverContentsAre (
 @"├-normal
 │ ├─pink
 │ └─normal
@@ -814,7 +814,7 @@ namespace Terminal.Gui.Views {
 			tv.Redraw (tv.Bounds);
 
 
-			GraphViewTests.AssertDriverContentsAre (
+			TestHelpers.AssertDriverContentsAre (
 @"├+normal
 └─pink
 ", output);
@@ -830,7 +830,7 @@ namespace Terminal.Gui.Views {
 			tv.Redraw (tv.Bounds);
 
 
-			GraphViewTests.AssertDriverContentsAre (
+			TestHelpers.AssertDriverContentsAre (
 @"└─pink
 ", output);
 			Assert.Equal (-1, tv.GetObjectRow (n1));
@@ -861,14 +861,14 @@ namespace Terminal.Gui.Views {
 			tv.Redraw(tv.Bounds);
 
 			// Normal drawing of the tree view
-			GraphViewTests.AssertDriverContentsAre(
+			TestHelpers.AssertDriverContentsAre(
 @"├-normal
 │ ├─pink
 │ └─normal
 └─pink
 ",output);
 			// Should all be the same color
-			GraphViewTests.AssertDriverColorsAre(
+			TestHelpers.AssertDriverColorsAre(
 @"00000000
 00000000
 0000000000
@@ -892,7 +892,7 @@ namespace Terminal.Gui.Views {
 			tv.Redraw(tv.Bounds);
 	
 			// Same text
-			GraphViewTests.AssertDriverContentsAre(
+			TestHelpers.AssertDriverContentsAre(
 @"├-normal
 │ ├─pink
 │ └─normal
@@ -900,7 +900,7 @@ namespace Terminal.Gui.Views {
 ",output);
 			// but now the item (only not lines) appear
 			// in pink when they are the word "pink"
-			GraphViewTests.AssertDriverColorsAre(
+			TestHelpers.AssertDriverColorsAre(
 @"00000000
 00001111
 0000000000

+ 60 - 60
UnitTests/ViewTests.cs

@@ -1504,7 +1504,7 @@ Hello     X
 Y          
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 11, 3), pos);
 
 			label.AutoSize = false;
@@ -1519,7 +1519,7 @@ Hello     X
 Y          
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 11, 3), pos);
 		}
 
@@ -1550,7 +1550,7 @@ o
 Y  
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 3, 11), pos);
 
 			label.AutoSize = false;
@@ -1573,7 +1573,7 @@ o
 Y  
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 3, 11), pos);
 		}
 
@@ -2119,7 +2119,7 @@ Y
 └──────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 8, 4), pos);
 		}
 
@@ -2141,7 +2141,7 @@ Y
 └┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 2, 2), pos);
 		}
 
@@ -2165,7 +2165,7 @@ Y
 ──────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 7, 4), pos);
 
 			view.Frame = new Rect (-1, -1, 8, 4);
@@ -2177,7 +2177,7 @@ Y
 ──────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (6, 0, 7, 3), pos);
 
 			view.Frame = new Rect (0, 0, 8, 4);
@@ -2190,7 +2190,7 @@ Y
 └──────
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 7, 4), pos);
 
 			view.Frame = new Rect (0, 0, 8, 4);
@@ -2232,7 +2232,7 @@ Y
  └──────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 1, 21, 14), pos);
 
 			Assert.True (scrollView.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ())));
@@ -2255,7 +2255,7 @@ Y
  └──────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 1, 21, 14), pos);
 
 			Assert.True (scrollView.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ())));
@@ -2278,7 +2278,7 @@ Y
  └──────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 1, 21, 14), pos);
 
 			Assert.True (scrollView.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ())));
@@ -2301,7 +2301,7 @@ Y
  └──────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 1, 21, 14), pos);
 
 			Assert.True (scrollView.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ())));
@@ -2324,7 +2324,7 @@ Y
  └──────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 1, 21, 14), pos);
 
 			Assert.True (scrollView.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ())));
@@ -2347,7 +2347,7 @@ Y
  └──────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 1, 21, 14), pos);
 
 			Assert.True (scrollView.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ())));
@@ -2370,7 +2370,7 @@ Y
  └──────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 1, 21, 14), pos);
 
 			Assert.True (scrollView.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ())));
@@ -2393,7 +2393,7 @@ Y
  └──────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 1, 21, 14), pos);
 
 			Assert.True (scrollView.ProcessKey (new KeyEvent (Key.CtrlMask | Key.Home, new KeyModifiers ())));
@@ -2417,7 +2417,7 @@ Y
  └──────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 1, 21, 14), pos);
 
 			Assert.True (scrollView.ProcessKey (new KeyEvent (Key.CursorDown, new KeyModifiers ())));
@@ -2440,7 +2440,7 @@ Y
  └──────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 1, 21, 14), pos);
 
 			Assert.True (scrollView.ProcessKey (new KeyEvent (Key.CursorDown, new KeyModifiers ())));
@@ -2463,7 +2463,7 @@ Y
  └──────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (1, 1, 21, 14), pos);
 		}
 
@@ -2503,7 +2503,7 @@ Y
 └──────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 20, 10), pos);
 
 			view.Clear ();
@@ -2511,7 +2511,7 @@ Y
 			expected = @"
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (Rect.Empty, pos);
 		}
 
@@ -2551,7 +2551,7 @@ Y
 └──────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 20, 10), pos);
 
 			view.Clear (view.Bounds);
@@ -2559,7 +2559,7 @@ Y
 			expected = @"
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (Rect.Empty, pos);
 		}
 
@@ -2626,7 +2626,7 @@ Y
 └──────────────────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 32, 32), pos);
 
 			verticalView.Text = $"最初の行{Environment.NewLine}二行目";
@@ -2667,7 +2667,7 @@ Y
 └──────────────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 32, 32), pos);
 		}
 
@@ -2714,7 +2714,7 @@ Y
 └────────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 22, 22), pos);
 
 			view.Text = "Hello World";
@@ -2751,7 +2751,7 @@ Y
 └────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 22, 22), pos);
 
 			view.AutoSize = true;
@@ -2788,7 +2788,7 @@ Y
 └────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 22, 22), pos);
 
 			view.TextDirection = TextDirection.TopBottom_LeftRight;
@@ -2824,7 +2824,7 @@ Y
 └────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 22, 22), pos);
 
 			view.AutoSize = false;
@@ -2861,7 +2861,7 @@ Y
 └────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 22, 22), pos);
 
 			view.PreserveTrailingSpaces = true;
@@ -2897,7 +2897,7 @@ Y
 └────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 22, 22), pos);
 
 			view.PreserveTrailingSpaces = false;
@@ -2937,7 +2937,7 @@ Y
 └────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 22, 22), pos);
 
 			view.AutoSize = true;
@@ -2973,7 +2973,7 @@ Y
 └────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 22, 22), pos);
 		}
 
@@ -3042,7 +3042,7 @@ Y
 └────────────────────┘
 ";
 
-			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 22, 22), pos);
 
 			verticalView.Text = $"最初_の行二行目";
@@ -3080,7 +3080,7 @@ Y
 └────────────────────┘
 ";
 
-			pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			Assert.Equal (new Rect (0, 0, 22, 22), pos);
 		}
 
@@ -3113,7 +3113,7 @@ Y
 └────────────────────────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 
 			Assert.True (btn.AutoSize);
 			btn.Text = "Say He_llo 你 changed";
@@ -3127,7 +3127,7 @@ Y
 └────────────────────────────┘
 ";
 
-			GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 		}
 
 		[Fact]
@@ -3500,7 +3500,7 @@ Y
 			Assert.False (view.AutoSize);
 			Assert.Equal (new Rect (0, 0, 10, 1), view.Frame);
 			Assert.Equal ("Test", view.TextFormatter.Text);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 Test
 ", output);
 
@@ -3509,7 +3509,7 @@ Test
 			Assert.Equal (new Rect (0, 0, 10, 1), view.Frame);
 			Assert.Equal ("First line\nSecond line", view.TextFormatter.Text);
 			Application.Refresh ();
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 First line
 ", output);
 
@@ -3518,7 +3518,7 @@ First line
 			Assert.Equal (new Rect (0, 0, 11, 2), view.Frame);
 			Assert.Equal ("First line\nSecond line", view.TextFormatter.Text);
 			Application.Refresh ();
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 First line 
 Second line
 ", output);
@@ -3528,7 +3528,7 @@ Second line
 			Assert.Equal (new Rect (0, 0, 10, 1), view.Frame);
 			Assert.Equal ("First line\nSecond line", view.TextFormatter.Text);
 			Application.Refresh ();
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 First line
 ", output);
 		}
@@ -3576,7 +3576,7 @@ First line
 			Assert.False (view.AutoSize);
 			Assert.Equal (new Rect (0, 0, 1, 10), view.Frame);
 			Assert.Equal ("Test", view.TextFormatter.Text);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 T
 e
 s
@@ -3588,7 +3588,7 @@ t
 			Assert.Equal (new Rect (0, 0, 1, 10), view.Frame);
 			Assert.Equal ("First line\nSecond line", view.TextFormatter.Text);
 			Application.Refresh ();
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 F
 i
 r
@@ -3606,7 +3606,7 @@ e
 			Assert.Equal (new Rect (0, 0, 2, 11), view.Frame);
 			Assert.Equal ("First line\nSecond line", view.TextFormatter.Text);
 			Application.Refresh ();
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 FS
 ie
 rc
@@ -3625,7 +3625,7 @@ en
 			Assert.Equal (new Rect (0, 0, 1, 10), view.Frame);
 			Assert.Equal ("First line\nSecond line", view.TextFormatter.Text);
 			Application.Refresh ();
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 F
 i
 r
@@ -3680,7 +3680,7 @@ e
 			Assert.False (view.AutoSize);
 			Assert.Equal (new Rect (0, 0, 10, 1), view.Frame);
 			Assert.Equal ("Test 你", view.TextFormatter.Text);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 Test 你
 ", output);
 
@@ -3689,7 +3689,7 @@ Test 你
 			Assert.Equal (new Rect (0, 0, 10, 1), view.Frame);
 			Assert.Equal ("First line 你\nSecond line 你", view.TextFormatter.Text);
 			Application.Refresh ();
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 First line
 ", output);
 
@@ -3698,7 +3698,7 @@ First line
 			Assert.Equal (new Rect (0, 0, 14, 2), view.Frame);
 			Assert.Equal ("First line 你\nSecond line 你", view.TextFormatter.Text);
 			Application.Refresh ();
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 First line 你 
 Second line 你
 ", output);
@@ -3708,7 +3708,7 @@ Second line 你
 			Assert.Equal (new Rect (0, 0, 10, 1), view.Frame);
 			Assert.Equal ("First line 你\nSecond line 你", view.TextFormatter.Text);
 			Application.Refresh ();
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 First line
 ", output);
 		}
@@ -3758,7 +3758,7 @@ First line
 			// SetMinWidthHeight ensuring the minimum width for the wide char
 			Assert.Equal (new Rect (0, 0, 2, 10), view.Frame);
 			Assert.Equal ("Test 你", view.TextFormatter.Text);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 T 
 e 
 s 
@@ -3772,7 +3772,7 @@ t
 			Assert.Equal (new Rect (0, 0, 2, 10), view.Frame);
 			Assert.Equal ("First line 你\nSecond line 你", view.TextFormatter.Text);
 			Application.Refresh ();
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 F
 i
 r
@@ -3790,7 +3790,7 @@ e
 			Assert.Equal (new Rect (0, 0, 4, 13), view.Frame);
 			Assert.Equal ("First line 你\nSecond line 你", view.TextFormatter.Text);
 			Application.Refresh ();
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 F S 
 i e 
 r c 
@@ -3811,7 +3811,7 @@ e n
 			Assert.Equal (new Rect (0, 0, 2, 10), view.Frame);
 			Assert.Equal ("First line 你\nSecond line 你", view.TextFormatter.Text);
 			Application.Refresh ();
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 F
 i
 r
@@ -3837,7 +3837,7 @@ e
 
 			Assert.True (label.Visible);
 			((FakeDriver)Application.Driver).SetBufferSize (30, 5);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌────────────────────────────┐
 │Testing visibility.         │
 │                            │
@@ -3846,7 +3846,7 @@ e
 ", output);
 
 			label.Visible = false;
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 ┌────────────────────────────┐
 │                            │
 │                            │
@@ -3869,7 +3869,7 @@ e
 			Application.Begin (Application.Top);
 
 			Assert.True (sbv.Visible);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is a tes▲
 This is a tes┬
 This is a tes┴
@@ -3881,7 +3881,7 @@ This is a tes▼
 			sbv.Visible = false;
 			Assert.False (sbv.Visible);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is a test
 This is a test
 This is a test
@@ -3893,7 +3893,7 @@ This is a test
 			sbv.Visible = true;
 			Assert.True (sbv.Visible);
 			Application.Top.Redraw (Application.Top.Bounds);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is a tes▲
 This is a tes┬
 This is a tes┴
@@ -3905,7 +3905,7 @@ This is a tes▼
 			sbv.ClearOnVisibleFalse = true;
 			sbv.Visible = false;
 			Assert.False (sbv.Visible);
-			GraphViewTests.AssertDriverContentsWithFrameAre (@"
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
 This is a tes
 This is a tes
 This is a tes

+ 3 - 3
UnitTests/WizardTests.cs

@@ -127,7 +127,7 @@ namespace Terminal.Gui.Views {
 
 			var wizard = new Wizard (title) { Width = width, Height = height };
 			Application.End (Application.Begin (wizard));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{row2}\n{row3}\n{separatorRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{row2}\n{row3}\n{separatorRow}\n{buttonRow}\n{bottomRow}", output);
 		}
 
 		[Fact, AutoInitShutdown]
@@ -164,7 +164,7 @@ namespace Terminal.Gui.Views {
 			var runstate = Application.Begin (wizard);
 			Application.RunMainLoopIteration (ref runstate, true, ref firstIteration);
 
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{row2}\n{row3}\n{row4}\n{separatorRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{row2}\n{row3}\n{row4}\n{separatorRow}\n{buttonRow}\n{bottomRow}", output);
 			Application.End (runstate);
 		}
 
@@ -231,7 +231,7 @@ namespace Terminal.Gui.Views {
 			wizard.AddStep (new Wizard.WizardStep ("ABCD"));
 
 			Application.End (Application.Begin (wizard));
-			GraphViewTests.AssertDriverContentsWithFrameAre ($"{topRow}\n{separatorRow}\n{buttonRow}\n{bottomRow}", output);
+			TestHelpers.AssertDriverContentsWithFrameAre ($"{topRow}\n{separatorRow}\n{buttonRow}\n{bottomRow}", output);
 		}
 
 		[Fact, AutoInitShutdown]