From df9ae1787131568d52934072a7188f7ab8995dd2 Mon Sep 17 00:00:00 2001 From: tznind Date: Sun, 22 Jan 2023 11:59:57 +0000 Subject: [PATCH] Add tests for insert middle and end --- UnitTests/SplitViewTests.cs | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/UnitTests/SplitViewTests.cs b/UnitTests/SplitViewTests.cs index 48c599292..1b7c1440e 100644 --- a/UnitTests/SplitViewTests.cs +++ b/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); }