Find() public method

public Find ( string key, bool searchAllChildren ) : System.Windows.Forms.MenuItem[]
key string
searchAllChildren bool
return System.Windows.Forms.MenuItem[]
Beispiel #1
0
        public void MenuItemCollection_Find_NullOrEmptyKey_ThrowsArgumentNullException(string key)
        {
            var menu       = new SubMenu(new MenuItem[0]);
            var collection = new Menu.MenuItemCollection(menu);

            Assert.Throws <ArgumentNullException>("key", () => collection.Find(key, searchAllChildren: false));
        }
Beispiel #2
0
        public void MenuItemCollection_Find_Invoke_ReturnsExpected(MenuItem[] items, string key, bool searchAllChildren, MenuItem[] expected)
        {
            var menu       = new SubMenu(items);
            var collection = new Menu.MenuItemCollection(menu);

            Assert.Equal(expected, collection.Find(key, searchAllChildren));
        }