Browse Source

Add unit test.

BDisp 2 năm trước cách đây
mục cha
commit
b13247342a
1 tập tin đã thay đổi với 19 bổ sung0 xóa
  1. 19 0
      UnitTests/TopLevels/WindowTests.cs

+ 19 - 0
UnitTests/TopLevels/WindowTests.cs

@@ -235,6 +235,25 @@ namespace Terminal.Gui.TopLevelTests {
 │└────────────────┘│
 │ ^Q Quit │ ^O Open│
 └──────────────────┘", output);
+		}
+
+		[Fact, AutoInitShutdown]
+		public void Activating_MenuBar_By_F9_Does_Not_Throw ()
+		{
+			var menu = new MenuBar (new MenuBarItem [] {
+				new MenuBarItem ("Child", new MenuItem [] {
+					new MenuItem ("_Create Child", "", null)
+				})
+			});
+			var win = new Window ();
+			win.Add (menu);
+			Application.Top.Add (win);
+			Application.Begin (Application.Top);
+
+			var exception = Record.Exception (() => win.ProcessHotKey (new KeyEvent (Key.AltMask, new KeyModifiers { Alt = true })));
+			Assert.Null (exception);
+		}
+
 
 		}
 	}