public static bool VerifyMenuItemLayout(Element actualElement, ExpectedMenuItemElement expected, out string errorDesc)
        {
            if (actualElement == null)
            {
                errorDesc = $"\nMenu item \"{expected.Label}\" not found.";
                return(false);
            }

            bool   result = true;
            string error  = string.Empty;

            if (!VerifyCommonElementLayout(actualElement, expected, out string errorDescription))
            {
                result = false;
            }

            errorDesc = errorDescription;

            if (!expected.VerifyLabel(actualElement, out error))
            {
                result = false;
            }
            errorDesc += error;

            if (!expected.VerifyItemsQuantity(actualElement, out error))
            {
                result = false;
            }
            errorDesc += error;

            if (!expected.VerifyItems(actualElement, out error))
            {
                result = false;
            }
            errorDesc += error;

            if (!expected.VerifyAccessKey(actualElement, out error))
            {
                result = false;
            }
            errorDesc += error;
            return(result);
        }
 public MenuItemConstraint(ExpectedMenuItemElement expected)
 {
     this.expectedElement = expected;
 }
 public static MenuItemConstraint MenuItemConstraint(ExpectedMenuItemElement expected)
 {
     return(new MenuItemConstraint(expected));
 }