osu.Framework.Tests/Visual/UserInterface/TestCaseNestedMenus.cs
/// <summary>
/// Tests whether clicking on the <see cref="Menu"/> that has <see cref="Menu.TopLevelMenu"/> closes all sub menus.
/// </summary>
Tests whether clicking on the  that has  closes all sub menus.
Tests whether clicking on the that has closes all sub menus .
[Test]
        public void TestMenuClickClosesSubMenus()
        {
            AddStep("Click item", () => clickItem(0, 1));
            AddStep("Click item", () => clickItem(1, 0));
            AddStep("Click item", () => clickItem(2, 0));
            AddStep("Click item", () => clickItem(3, 0));
            AddStep("Click item", () => clickItem(0, 1));
            AddAssert("Check submenus closed", () =>
            {
                for (int j = 1; j <= 3; j++)
                {
                    int menuIndex2 = j;
                    if (menus.GetSubMenu(menuIndex2).State == MenuState.Open)
                        return false;
                }
                return true;
            });
        }
[ Test ] public void TestMenuClickClosesSubMenus ( ) { AddStep ( " " , ( ) => clickItem ( 0 , 1 ) ) ; AddStep ( " " , ( ) => clickItem ( 1 , 0 ) ) ; AddStep ( " " , ( ) => clickItem ( 2 , 0 ) ) ; AddStep ( " " , ( ) => clickItem ( 3 , 0 ) ) ; AddStep ( " " , ( ) => clickItem ( 0 , 1 ) ) ; AddAssert ( " " , ( ) => { for ( int j = 1 ; j <= 3 ; j ++ ) { int menuIndex2 = j ; if ( menus . GetSubMenu ( menuIndex2 ) . State == MenuState . Open ) return false ; } return true ; } ) ; }
Tests whether clicking on the  that has  closes all sub menus.
Tests whether clicking on the that has closes all sub menus .