123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757 |
- using JetBrains.Annotations;
- namespace Terminal.Gui.ViewsTests;
- [TestSubject (typeof (Shortcut))]
- public class ShortcutTests
- {
- [Fact]
- public void Constructor_Defaults ()
- {
- var shortcut = new Shortcut ();
- Assert.NotNull (shortcut);
- Assert.True (shortcut.CanFocus);
- Assert.IsType<DimAuto> (shortcut.Width);
- Assert.IsType<DimAuto> (shortcut.Height);
- }
- [Fact]
- public void Size_Defaults ()
- {
- var shortcut = new Shortcut ();
- shortcut.SetRelativeLayout (new (100, 100));
- Assert.Equal (2, shortcut.Frame.Width);
- Assert.Equal (1, shortcut.Frame.Height);
- Assert.Equal (2, shortcut.Viewport.Width);
- Assert.Equal (1, shortcut.Viewport.Height);
- Assert.Equal (0, shortcut.CommandView.Viewport.Width);
- Assert.Equal (1, shortcut.CommandView.Viewport.Height);
- Assert.Equal (0, shortcut.HelpView.Viewport.Width);
- Assert.Equal (1, shortcut.HelpView.Viewport.Height);
- Assert.Equal (0, shortcut.KeyView.Viewport.Width);
- Assert.Equal (1, shortcut.KeyView.Viewport.Height);
- // 0123456789
- // " 0 A "
- shortcut = new Shortcut ()
- {
- Key = Key.A,
- HelpText = "0"
- };
- shortcut.SetRelativeLayout (new (100, 100));
- Assert.Equal (8, shortcut.Frame.Width);
- Assert.Equal (1, shortcut.Frame.Height);
- Assert.Equal (8, shortcut.Viewport.Width);
- Assert.Equal (1, shortcut.Viewport.Height);
- Assert.Equal (0, shortcut.CommandView.Viewport.Width);
- Assert.Equal (1, shortcut.CommandView.Viewport.Height);
- Assert.Equal (1, shortcut.HelpView.Viewport.Width);
- Assert.Equal (1, shortcut.HelpView.Viewport.Height);
- Assert.Equal (1, shortcut.KeyView.Viewport.Width);
- Assert.Equal (1, shortcut.KeyView.Viewport.Height);
- // 0123456789
- // " C 0 A "
- shortcut = new Shortcut ()
- {
- Title = "C",
- Key = Key.A,
- HelpText = "0"
- };
- shortcut.SetRelativeLayout (new (100, 100));
- Assert.Equal (9, shortcut.Frame.Width);
- Assert.Equal (1, shortcut.Frame.Height);
- Assert.Equal (9, shortcut.Viewport.Width);
- Assert.Equal (1, shortcut.Viewport.Height);
- Assert.Equal (1, shortcut.CommandView.Viewport.Width);
- Assert.Equal (1, shortcut.CommandView.Viewport.Height);
- Assert.Equal (1, shortcut.HelpView.Viewport.Width);
- Assert.Equal (1, shortcut.HelpView.Viewport.Height);
- Assert.Equal (1, shortcut.KeyView.Viewport.Width);
- Assert.Equal (1, shortcut.KeyView.Viewport.Height);
- }
- [Theory]
- [InlineData ("", "", KeyCode.Null, 2)]
- [InlineData ("C", "", KeyCode.Null, 3)]
- [InlineData ("", "H", KeyCode.Null, 5)]
- [InlineData ("", "", KeyCode.K, 5)]
- [InlineData ("C", "", KeyCode.K, 6)]
- [InlineData ("C", "H", KeyCode.Null, 6)]
- [InlineData ("", "H", KeyCode.K, 8)]
- [InlineData ("C", "H", KeyCode.K, 9)]
- public void NaturalSize (string command, string help, KeyCode key, int expectedWidth)
- {
- var shortcut = new Shortcut
- {
- Title = command,
- HelpText = help,
- Key = key
- };
- Assert.IsType<DimAuto> (shortcut.Width);
- Assert.IsType<DimAuto> (shortcut.Height);
- shortcut.SetRelativeLayout (new (100, 100));
- // |0123456789
- // | C H K |
- Assert.Equal (expectedWidth, shortcut.Frame.Width);
- }
- [Theory]
- [InlineData (5, 0, 3, 6)]
- [InlineData (6, 0, 3, 6)]
- [InlineData (7, 0, 3, 6)]
- [InlineData (8, 0, 3, 6)]
- [InlineData (9, 0, 3, 6)]
- [InlineData (10, 0, 4, 7)]
- [InlineData (11, 0, 5, 8)]
- public void Set_Width_Layouts_Correctly (int width, int expectedCmdX, int expectedHelpX, int expectedKeyX)
- {
- var shortcut = new Shortcut
- {
- Width = width,
- Title = "C",
- Text = "H",
- Key = Key.K
- };
- shortcut.LayoutSubviews ();
- shortcut.SetRelativeLayout (new (100, 100));
- // 0123456789
- // -C--H--K-
- Assert.Equal (expectedCmdX, shortcut.CommandView.Frame.X);
- Assert.Equal (expectedHelpX, shortcut.HelpView.Frame.X);
- Assert.Equal (expectedKeyX, shortcut.KeyView.Frame.X);
- }
- [Fact]
- public void CommandView_Text_And_Title_Track ()
- {
- var shortcut = new Shortcut
- {
- Title = "T"
- };
- Assert.Equal (shortcut.Title, shortcut.CommandView.Text);
- shortcut = new ();
- shortcut.CommandView = new ()
- {
- Text = "T"
- };
- Assert.Equal (shortcut.Title, shortcut.CommandView.Text);
- }
- [Fact]
- public void HelpText_And_Text_Are_The_Same ()
- {
- var shortcut = new Shortcut
- {
- Text = "H"
- };
- Assert.Equal (shortcut.Text, shortcut.HelpText);
- shortcut = new ()
- {
- HelpText = "H"
- };
- Assert.Equal (shortcut.Text, shortcut.HelpText);
- }
- [Theory]
- [InlineData (KeyCode.Null, "")]
- [InlineData (KeyCode.F1, "F1")]
- public void KeyView_Text_Tracks_Key (KeyCode key, string expected)
- {
- var shortcut = new Shortcut
- {
- Key = key
- };
- Assert.Equal (expected, shortcut.KeyView.Text);
- }
- // Test Key
- [Fact]
- public void Key_Defaults_To_Empty ()
- {
- var shortcut = new Shortcut ();
- Assert.Equal (Key.Empty, shortcut.Key);
- }
- [Fact]
- public void Key_Can_Be_Set ()
- {
- var shortcut = new Shortcut ();
- shortcut.Key = Key.F1;
- Assert.Equal (Key.F1, shortcut.Key);
- }
- [Fact]
- public void Key_Can_Be_Set_To_Empty ()
- {
- var shortcut = new Shortcut ();
- shortcut.Key = Key.Empty;
- Assert.Equal (Key.Empty, shortcut.Key);
- }
- [Fact]
- public void Key_Set_Binds_Key_To_CommandView_Accept ()
- {
- var shortcut = new Shortcut ();
- shortcut.Key = Key.F1;
- // TODO:
- }
- [Fact]
- public void Key_Changing_Removes_Previous_Binding ()
- {
- Shortcut shortcut = new Shortcut ();
- shortcut.Key = Key.A;
- Assert.Contains (Key.A, shortcut.KeyBindings.Bindings.Keys);
- shortcut.Key = Key.B;
- Assert.DoesNotContain (Key.A, shortcut.KeyBindings.Bindings.Keys);
- Assert.Contains (Key.B, shortcut.KeyBindings.Bindings.Keys);
- }
- // Test Key gets bound correctly
- [Fact]
- public void KeyBindingScope_Defaults_To_HotKey ()
- {
- var shortcut = new Shortcut ();
- Assert.Equal (KeyBindingScope.HotKey, shortcut.KeyBindingScope);
- }
- [Fact]
- public void KeyBindingScope_Can_Be_Set ()
- {
- var shortcut = new Shortcut ();
- shortcut.KeyBindingScope = KeyBindingScope.Application;
- Assert.Equal (KeyBindingScope.Application, shortcut.KeyBindingScope);
- }
- [Fact]
- public void KeyBindingScope_Changing_Adjusts_KeyBindings ()
- {
- Shortcut shortcut = new Shortcut ();
- shortcut.Key = Key.A;
- Assert.Contains (Key.A, shortcut.KeyBindings.Bindings.Keys);
- shortcut.KeyBindingScope = KeyBindingScope.Application;
- Assert.DoesNotContain (Key.A, shortcut.KeyBindings.Bindings.Keys);
- Assert.Contains (Key.A, Application.KeyBindings.Bindings.Keys);
- shortcut.KeyBindingScope = KeyBindingScope.HotKey;
- Assert.Contains (Key.A, shortcut.KeyBindings.Bindings.Keys);
- Assert.DoesNotContain (Key.A, Application.KeyBindings.Bindings.Keys);
- }
- [Theory]
- [InlineData (Orientation.Horizontal)]
- [InlineData (Orientation.Vertical)]
- public void Orientation_SetsCorrectly (Orientation orientation)
- {
- var shortcut = new Shortcut
- {
- Orientation = orientation
- };
- Assert.Equal (orientation, shortcut.Orientation);
- }
- [Theory]
- [InlineData (AlignmentModes.StartToEnd)]
- [InlineData (AlignmentModes.EndToStart)]
- public void AlignmentModes_SetsCorrectly (AlignmentModes alignmentModes)
- {
- var shortcut = new Shortcut
- {
- AlignmentModes = alignmentModes
- };
- Assert.Equal (alignmentModes, shortcut.AlignmentModes);
- }
- [Fact]
- public void Action_SetsAndGetsCorrectly ()
- {
- var actionInvoked = false;
- var shortcut = new Shortcut
- {
- Action = () => { actionInvoked = true; }
- };
- shortcut.Action.Invoke ();
- Assert.True (actionInvoked);
- }
- [Fact]
- public void Subview_Visibility_Controlled_By_Removal ()
- {
- var shortcut = new Shortcut ();
- Assert.True (shortcut.CommandView.Visible);
- Assert.Contains (shortcut.CommandView, shortcut.Subviews);
- Assert.True (shortcut.HelpView.Visible);
- Assert.DoesNotContain (shortcut.HelpView, shortcut.Subviews);
- Assert.True (shortcut.KeyView.Visible);
- Assert.DoesNotContain (shortcut.KeyView, shortcut.Subviews);
- shortcut.HelpText = "help";
- Assert.True (shortcut.HelpView.Visible);
- Assert.Contains (shortcut.HelpView, shortcut.Subviews);
- Assert.True (shortcut.KeyView.Visible);
- Assert.DoesNotContain (shortcut.KeyView, shortcut.Subviews);
- shortcut.Key = Key.A;
- Assert.True (shortcut.HelpView.Visible);
- Assert.Contains (shortcut.HelpView, shortcut.Subviews);
- Assert.True (shortcut.KeyView.Visible);
- Assert.Contains (shortcut.KeyView, shortcut.Subviews);
- shortcut.HelpView.Visible = false;
- shortcut.ShowHide ();
- Assert.False (shortcut.HelpView.Visible);
- Assert.DoesNotContain (shortcut.HelpView, shortcut.Subviews);
- Assert.True (shortcut.KeyView.Visible);
- Assert.Contains (shortcut.KeyView, shortcut.Subviews);
- shortcut.KeyView.Visible = false;
- shortcut.ShowHide ();
- Assert.False (shortcut.HelpView.Visible);
- Assert.DoesNotContain (shortcut.HelpView, shortcut.Subviews);
- Assert.False (shortcut.KeyView.Visible);
- Assert.DoesNotContain (shortcut.KeyView, shortcut.Subviews);
- }
- [Fact]
- public void Focus_CanFocus_Default_Is_True ()
- {
- Shortcut shortcut = new ();
- shortcut.Key = Key.A;
- shortcut.Text = "Help";
- shortcut.Title = "Command";
- Assert.True (shortcut.CanFocus);
- Assert.False (shortcut.CommandView.CanFocus);
- }
- [Fact]
- public void Focus_CanFocus_CommandView_Add_Tracks ()
- {
- Shortcut shortcut = new ();
- Assert.True (shortcut.CanFocus);
- Assert.False (shortcut.CommandView.CanFocus);
- shortcut.CommandView = new () { CanFocus = true };
- Assert.False (shortcut.CommandView.CanFocus);
- shortcut.CommandView.CanFocus = true;
- Assert.True (shortcut.CommandView.CanFocus);
- shortcut.CanFocus = false;
- Assert.False (shortcut.CanFocus);
- Assert.True (shortcut.CommandView.CanFocus);
- shortcut.CommandView.CanFocus = false;
- Assert.False (shortcut.CanFocus);
- Assert.False (shortcut.CommandView.CanFocus);
- shortcut.CommandView.CanFocus = true;
- Assert.False (shortcut.CanFocus);
- Assert.True (shortcut.CommandView.CanFocus);
- }
- [Theory]
- // 0123456789
- // " C 0 A "
- [InlineData (-1, 0)]
- [InlineData (0, 1)]
- [InlineData (1, 1)]
- [InlineData (2, 1)]
- [InlineData (3, 1)]
- [InlineData (4, 1)]
- [InlineData (5, 1)]
- [InlineData (6, 1)]
- [InlineData (7, 1)]
- [InlineData (8, 1)]
- [InlineData (9, 0)]
- [AutoInitShutdown]
- public void MouseClick_Fires_Accept (int x, int expectedAccept)
- {
- var current = new Toplevel ();
- var shortcut = new Shortcut
- {
- Key = Key.A,
- Text = "0",
- Title = "C"
- };
- current.Add (shortcut);
- Application.Begin (current);
- var accepted = 0;
- shortcut.Accept += (s, e) => accepted++;
- Application.OnMouseEvent (
- new ()
- {
- ScreenPosition = new (x, 0),
- Flags = MouseFlags.Button1Clicked
- });
- Assert.Equal (expectedAccept, accepted);
- current.Dispose ();
- }
- [Theory]
- // 0123456789
- // " C 0 A "
- [InlineData (-1, 0, 0, 0, 0)]
- [InlineData (0, 1, 0, 1, 1)]
- //[InlineData (1, 1, 1)]
- //[InlineData (2, 1, 0)]
- //[InlineData (3, 1, 0)]
- //[InlineData (4, 1, 0)]
- //[InlineData (5, 1, 0)]
- //[InlineData (6, 1, 0)]
- //[InlineData (7, 1, 0)]
- //[InlineData (8, 1, 0)]
- //[InlineData (9, 0, 0)]
- public void MouseClick_Default_CommandView_Raises_Accept_Select_Correctly (int mouseX, int expectedCommandViewAccept, int expectedCommandViewSelect, int expectedShortcutAccept, int expectedShortcutSelect)
- {
- Application.Top = new Toplevel ();
- var shortcut = new Shortcut
- {
- Title = "C",
- Key = Key.A,
- HelpText = "0"
- };
- var commandViewAcceptCount = 0;
- shortcut.CommandView.Accept += (s, e) =>
- {
- commandViewAcceptCount++;
- };
- var commandViewSelectCount = 0;
- shortcut.CommandView.Select += (s, e) =>
- {
- commandViewSelectCount++;
- };
- var shortcutAcceptCount = 0;
- shortcut.Accept += (s, e) =>
- {
- shortcutAcceptCount++;
- };
- var shortcutSelectCount = 0;
- shortcut.Select += (s, e) =>
- {
- shortcutSelectCount++;
- };
- Application.Top.Add (shortcut);
- Application.Top.SetRelativeLayout (new (100, 100));
- Application.OnMouseEvent (
- new ()
- {
- ScreenPosition = new (mouseX, 0),
- Flags = MouseFlags.Button1Clicked
- });
- Assert.Equal (expectedShortcutAccept, shortcutAcceptCount);
- Assert.Equal (expectedCommandViewAccept, commandViewAcceptCount);
- Assert.Equal (expectedShortcutSelect, shortcutSelectCount);
- Assert.Equal (expectedCommandViewSelect, commandViewSelectCount);
- Application.Top.Dispose ();
- Application.ResetState (true);
- }
- [Theory]
- // 0123456789
- // " C 0 A "
- [InlineData (-1, 0, 0)]
- [InlineData (0, 1, 0)]
- [InlineData (1, 1, 1)]
- [InlineData (2, 1, 0)]
- [InlineData (3, 1, 0)]
- [InlineData (4, 1, 0)]
- [InlineData (5, 1, 0)]
- [InlineData (6, 1, 0)]
- [InlineData (7, 1, 0)]
- [InlineData (8, 1, 0)]
- [InlineData (9, 0, 0)]
- public void MouseClick_Button_CommandView_Fires_Shortcut_Accept (int mouseX, int expectedAccept, int expectedButtonAccept)
- {
- Application.Top = new Toplevel ();
- var shortcut = new Shortcut
- {
- Key = Key.A,
- Text = "0"
- };
- shortcut.CommandView = new Button
- {
- Title = "C",
- NoDecorations = true,
- NoPadding = true,
- CanFocus = false
- };
- var buttonAccepted = 0;
- shortcut.CommandView.Accept += (s, e) =>
- {
- buttonAccepted++;
- // Must indicate handled
- e.Handled = true;
- };
- Application.Top.Add (shortcut);
- var accepted = 0;
- shortcut.Accept += (s, e) => accepted++;
- //Assert.True (shortcut.HasFocus);
- Application.OnMouseEvent (
- new ()
- {
- ScreenPosition = new (mouseX, 0),
- Flags = MouseFlags.Button1Clicked
- });
- Assert.Equal (expectedButtonAccept, buttonAccepted);
- Assert.Equal (expectedAccept, accepted);
- Application.Top.Dispose ();
- Application.ResetState (true);
- }
- [Theory]
- [InlineData (true, KeyCode.A, 1)]
- [InlineData (true, KeyCode.C, 1)]
- [InlineData (true, KeyCode.C | KeyCode.AltMask, 1)]
- [InlineData (true, KeyCode.Enter, 1)]
- [InlineData (true, KeyCode.Space, 0)]
- [InlineData (true, KeyCode.F1, 0)]
- [InlineData (false, KeyCode.A, 1)]
- [InlineData (false, KeyCode.C, 1)]
- [InlineData (false, KeyCode.C | KeyCode.AltMask, 1)]
- [InlineData (false, KeyCode.Enter, 0)]
- [InlineData (false, KeyCode.Space, 0)]
- [InlineData (false, KeyCode.F1, 0)]
- [AutoInitShutdown]
- public void KeyDown_Invokes_Accept (bool canFocus, KeyCode key, int expectedAccept)
- {
- var current = new Toplevel ();
- var shortcut = new Shortcut
- {
- Key = Key.A,
- Text = "0",
- Title = "_C",
- CanFocus = canFocus
- };
- current.Add (shortcut);
- Application.Begin (current);
- Assert.Equal (canFocus, shortcut.HasFocus);
- var accepted = 0;
- shortcut.Accept += (s, e) => accepted++;
- Application.OnKeyDown (key);
- Assert.Equal (expectedAccept, accepted);
- current.Dispose ();
- }
- [Theory]
- [InlineData (KeyCode.A, 1)]
- [InlineData (KeyCode.C, 1)]
- [InlineData (KeyCode.C | KeyCode.AltMask, 1)]
- [InlineData (KeyCode.Enter, 1)]
- [InlineData (KeyCode.Space, 0)]
- [InlineData (KeyCode.F1, 0)]
- public void KeyDown_App_Scope_Invokes_Accept (KeyCode key, int expectedAccept)
- {
- Application.Top = new Toplevel ();
- var shortcut = new Shortcut
- {
- Key = Key.A,
- KeyBindingScope = KeyBindingScope.Application,
- Text = "0",
- Title = "_C"
- };
- Application.Top.Add (shortcut);
- Application.Top.SetFocus ();
- var accepted = 0;
- shortcut.Accept += (s, e) => accepted++;
- Application.OnKeyDown (key);
- Assert.Equal (expectedAccept, accepted);
- Application.Top.Dispose ();
- Application.ResetState (true);
- }
- [Theory]
- [InlineData (true, KeyCode.A, 1)]
- [InlineData (true, KeyCode.C, 1)]
- [InlineData (true, KeyCode.C | KeyCode.AltMask, 1)]
- [InlineData (true, KeyCode.Enter, 1)]
- [InlineData (true, KeyCode.Space, 0)]
- [InlineData (true, KeyCode.F1, 0)]
- [InlineData (false, KeyCode.A, 1)]
- [InlineData (false, KeyCode.C, 1)]
- [InlineData (false, KeyCode.C | KeyCode.AltMask, 1)]
- [InlineData (false, KeyCode.Enter, 0)]
- [InlineData (false, KeyCode.Space, 0)]
- [InlineData (false, KeyCode.F1, 0)]
- [AutoInitShutdown]
- public void KeyDown_Invokes_Action (bool canFocus, KeyCode key, int expectedAction)
- {
- var current = new Toplevel ();
- var shortcut = new Shortcut
- {
- Key = Key.A,
- Text = "0",
- Title = "_C",
- CanFocus = canFocus
- };
- current.Add (shortcut);
- Application.Begin (current);
- Assert.Equal (canFocus, shortcut.HasFocus);
- var action = 0;
- shortcut.Action += () => action++;
- Application.OnKeyDown (key);
- Assert.Equal (expectedAction, action);
- current.Dispose ();
- }
- [Theory]
- [InlineData (true, KeyCode.A, 1)]
- [InlineData (true, KeyCode.C, 1)]
- [InlineData (true, KeyCode.C | KeyCode.AltMask, 1)]
- [InlineData (true, KeyCode.Enter, 1)]
- [InlineData (true, KeyCode.Space, 0)]
- [InlineData (true, KeyCode.F1, 0)]
- [InlineData (false, KeyCode.A, 1)]
- [InlineData (false, KeyCode.C, 1)]
- [InlineData (false, KeyCode.C | KeyCode.AltMask, 1)]
- [InlineData (false, KeyCode.Enter, 0)]
- [InlineData (false, KeyCode.Space, 0)]
- [InlineData (false, KeyCode.F1, 0)]
- [AutoInitShutdown]
- public void KeyDown_App_Scope_Invokes_Action (bool canFocus, KeyCode key, int expectedAction)
- {
- Application.Top = new Toplevel ();
- var shortcut = new Shortcut
- {
- Key = Key.A,
- KeyBindingScope = KeyBindingScope.Application,
- Text = "0",
- Title = "_C",
- CanFocus = canFocus
- };
- Application.Top.Add (shortcut);
- Application.Top.SetFocus ();
- var action = 0;
- shortcut.Action += () => action++;
- Application.OnKeyDown (key);
- Assert.Equal (expectedAction, action);
- Application.Top.Dispose ();
- Application.ResetState (true);
- }
- [Fact]
- public void ColorScheme_SetsAndGetsCorrectly ()
- {
- var colorScheme = new ColorScheme ();
- var shortcut = new Shortcut
- {
- ColorScheme = colorScheme
- };
- Assert.Same (colorScheme, shortcut.ColorScheme);
- }
- // https://github.com/gui-cs/Terminal.Gui/issues/3664
- [Fact]
- public void ColorScheme_SetColorScheme_Does_Not_Fault_3664 ()
- {
- Application.Top = new ();
- Application.Navigation = new ();
- Shortcut shortcut = new Shortcut ();
- Application.Top.ColorScheme = null;
- Assert.Null (shortcut.ColorScheme);
- shortcut.HasFocus = true;
- Assert.NotNull (shortcut.ColorScheme);
- Application.Top.Dispose ();
- Application.ResetState ();
- }
- }
|