Browse Source

Add tests for insert middle and end

tznind 2 years ago
parent
commit
df9ae17871
1 changed files with 38 additions and 0 deletions
  1. 38 0
      UnitTests/SplitViewTests.cs

+ 38 - 0
UnitTests/SplitViewTests.cs

@@ -396,6 +396,44 @@ namespace UnitTests {
 @"
 ┌──┬───┬──┐
 │  │111│22│
+└──┴───┴──┘";
+			TestHelpers.AssertDriverContentsAre (looksLike, output);
+		}
+		
+		[Fact, AutoInitShutdown]
+		public void TestSplitView_InsertPanelMiddle()
+		{
+			var splitContainer = Get11By3SplitView (out var line, true);
+			SetInputFocusLine (splitContainer);
+
+			splitContainer.InsertTile (1);
+
+			splitContainer.Redraw (splitContainer.Bounds);
+
+			// so should ignore the 2 distance and stick to 6
+			string looksLike =
+@"
+┌──┬───┬──┐
+│11│   │22│
+└──┴───┴──┘";
+			TestHelpers.AssertDriverContentsAre (looksLike, output);
+		}
+
+		[Fact, AutoInitShutdown]
+		public void TestSplitView_InsertPanelAtEnd ()
+		{
+			var splitContainer = Get11By3SplitView (out var line, true);
+			SetInputFocusLine (splitContainer);
+
+			splitContainer.InsertTile (2);
+
+			splitContainer.Redraw (splitContainer.Bounds);
+
+			// so should ignore the 2 distance and stick to 6
+			string looksLike =
+@"
+┌──┬───┬──┐
+│11│222│  │
 └──┴───┴──┘";
 			TestHelpers.AssertDriverContentsAre (looksLike, output);
 		}