|
@@ -9,7 +9,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
public void TestAutoAppend_AfterCloseKey_NoAutocomplete ()
|
|
|
{
|
|
|
TextField tf = GetTextFieldsInViewSuggesting ("fish");
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
// f is typed and suggestion is "fish"
|
|
|
Application.Driver?.SendKeys ('f', ConsoleKey.F, false, false, false);
|
|
|
tf.Draw ();
|
|
@@ -21,7 +21,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
Application.Driver?.SendKeys ('e', ConsoleKey.Escape, false, false, false);
|
|
|
|
|
|
// Suggestion should disappear
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
TestHelpers.AssertDriverContentsAre ("f", output);
|
|
|
Assert.Equal ("f", tf.Text);
|
|
@@ -43,7 +43,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
|
|
|
// f is typed and suggestion is "fish"
|
|
|
Application.Driver?.SendKeys ('f', ConsoleKey.F, false, false, false);
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
tf.PositionCursor ();
|
|
|
TestHelpers.AssertDriverContentsAre ("fish", output);
|
|
@@ -53,7 +53,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
Application.Driver?.SendKeys ('\0', ConsoleKey.Escape, false, false, false);
|
|
|
|
|
|
// Suggestion should disappear
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
TestHelpers.AssertDriverContentsAre ("f", output);
|
|
|
Assert.Equal ("f", tf.Text);
|
|
@@ -61,7 +61,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
// Should reappear when you press next letter
|
|
|
Application.Driver?.SendKeys ('i', ConsoleKey.I, false, false, false);
|
|
|
tf.PositionCursor ();
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
TestHelpers.AssertDriverContentsAre ("fish", output);
|
|
|
Assert.Equal ("fi", tf.Text);
|
|
@@ -78,7 +78,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
|
|
|
// f is typed and suggestion is "fish"
|
|
|
Application.Driver?.SendKeys ('f', ConsoleKey.F, false, false, false);
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
tf.PositionCursor ();
|
|
|
TestHelpers.AssertDriverContentsAre ("fish", output);
|
|
@@ -87,7 +87,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
// When cycling autocomplete
|
|
|
Application.Driver?.SendKeys (' ', cycleKey, false, false, false);
|
|
|
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
tf.PositionCursor ();
|
|
|
TestHelpers.AssertDriverContentsAre ("friend", output);
|
|
@@ -95,7 +95,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
|
|
|
// Should be able to cycle in circles endlessly
|
|
|
Application.Driver?.SendKeys (' ', cycleKey, false, false, false);
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
tf.PositionCursor ();
|
|
|
TestHelpers.AssertDriverContentsAre ("fish", output);
|
|
@@ -111,7 +111,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
|
|
|
// f is typed and suggestion is "fish"
|
|
|
Application.Driver?.SendKeys ('f', ConsoleKey.F, false, false, false);
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
tf.PositionCursor ();
|
|
|
TestHelpers.AssertDriverContentsAre ("fish", output);
|
|
@@ -121,7 +121,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
Application.Driver?.SendKeys (' ', ConsoleKey.Spacebar, false, false, false);
|
|
|
Application.Driver?.SendKeys ('<', ConsoleKey.LeftArrow, false, false, false);
|
|
|
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
TestHelpers.AssertDriverContentsAre ("f", output);
|
|
|
Assert.Equal ("f ", tf.Text);
|
|
@@ -136,7 +136,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
|
|
|
// f is typed and suggestion is "fish"
|
|
|
Application.Driver?.SendKeys ('f', ConsoleKey.F, false, false, false);
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
tf.PositionCursor ();
|
|
|
TestHelpers.AssertDriverContentsAre ("fish", output);
|
|
@@ -144,7 +144,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
|
|
|
// x is typed and suggestion should disappear
|
|
|
Application.Driver?.SendKeys ('x', ConsoleKey.X, false, false, false);
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
TestHelpers.AssertDriverContentsAre ("fx", output);
|
|
|
Assert.Equal ("fx", tf.Text);
|
|
@@ -161,7 +161,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
var generator = (SingleWordSuggestionGenerator)tf.Autocomplete.SuggestionGenerator;
|
|
|
generator.AllSuggestions = new List<string> { "FISH" };
|
|
|
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
tf.PositionCursor ();
|
|
|
TestHelpers.AssertDriverContentsAre ("", output);
|
|
@@ -172,7 +172,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
Assert.Equal ("my f", tf.Text);
|
|
|
|
|
|
// Even though there is no match on case we should still get the suggestion
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
tf.PositionCursor ();
|
|
|
TestHelpers.AssertDriverContentsAre ("my fISH", output);
|
|
@@ -180,7 +180,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
|
|
|
// When tab completing the case of the whole suggestion should be applied
|
|
|
Application.Driver?.SendKeys ('\t', ConsoleKey.Tab, false, false, false);
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
TestHelpers.AssertDriverContentsAre ("my FISH", output);
|
|
|
Assert.Equal ("my FISH", tf.Text);
|
|
@@ -197,14 +197,14 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
var generator = (SingleWordSuggestionGenerator)tf.Autocomplete.SuggestionGenerator;
|
|
|
generator.AllSuggestions = new List<string> { "fish" };
|
|
|
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
tf.PositionCursor ();
|
|
|
TestHelpers.AssertDriverContentsAre ("", output);
|
|
|
|
|
|
tf.NewKeyDownEvent (new Key ('f'));
|
|
|
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
tf.PositionCursor ();
|
|
|
TestHelpers.AssertDriverContentsAre ("fish", output);
|
|
@@ -212,7 +212,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
|
|
|
Application.Driver?.SendKeys ('\t', ConsoleKey.Tab, false, false, false);
|
|
|
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
TestHelpers.AssertDriverContentsAre ("fish", output);
|
|
|
Assert.Equal ("fish", tf.Text);
|
|
@@ -237,7 +237,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
|
|
|
|
|
|
// f is typed we should only see 'f' up to size of View (10)
|
|
|
Application.Driver?.SendKeys ('f', ConsoleKey.F, false, false, false);
|
|
|
- Application.ClipToScreen ();
|
|
|
+ View.SetClipToScreen ();
|
|
|
tf.Draw ();
|
|
|
tf.PositionCursor ();
|
|
|
TestHelpers.AssertDriverContentsAre (expectRender, output);
|