From 00922d2d837053db157d25ac0621da0dd68649b6 Mon Sep 17 00:00:00 2001 From: huguesv Date: Fri, 1 Apr 2016 15:38:13 -0700 Subject: [PATCH] Add test to make sure that blank input is not added to history. --- .../InteractiveWindowHistoryTests.cs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/InteractiveWindow/EditorTest/InteractiveWindowHistoryTests.cs b/src/InteractiveWindow/EditorTest/InteractiveWindowHistoryTests.cs index 409dc4897e2..3d635ba7b86 100644 --- a/src/InteractiveWindow/EditorTest/InteractiveWindowHistoryTests.cs +++ b/src/InteractiveWindow/EditorTest/InteractiveWindowHistoryTests.cs @@ -76,6 +76,29 @@ public async Task CheckHistoryPrevious() AssertCurrentSubmission(inputString); } + [WpfFact] + public async Task CheckHistoryPreviousWithAnEmptySubmission() { + //submit, submit, submit, up, up, up + const string inputString1 = "1 "; + const string inputString2 = " "; + const string inputString3 = "3 "; + + await InsertAndExecuteInput(inputString1).ConfigureAwait(true); + await InsertAndExecuteInput(inputString2).ConfigureAwait(true); + await InsertAndExecuteInput(inputString3).ConfigureAwait(true); + + _operations.HistoryPrevious(); + AssertCurrentSubmission(inputString3); + + //second input was empty, so it wasn't added to history + _operations.HistoryPrevious(); + AssertCurrentSubmission(inputString1); + + //has reached the top, no change + _operations.HistoryPrevious(); + AssertCurrentSubmission(inputString1); + } + [WpfFact] public async Task CheckHistoryPreviousNotCircular() { -- GitLab