Ejemplo n.º 1
0
        static T[] GetArray <T>(GetElement <T> getElement)
        {
            const int ELEMENTOS = 10;

            T[] array = new T[ELEMENTOS];
            for (int i = 0; i < array.Length; i++)
            {
                array[i] = getElement();
            }
            return(array);
        }
Ejemplo n.º 2
0
        /// <summary cref="IValueVisitor.Visit(GetElement)"/>
        public void Visit(GetElement value)
        {
            var source = Load(value.ObjectValue);
            var index  = Load(value.Index);
            var target = Allocate(value);

            using (var statement = BeginStatement(target))
            {
                statement.AppendArgument(source);
                statement.AppendIndexer(index);
            }
        }
Ejemplo n.º 3
0
        static bool TestAny <T>(GetElement <T> getElement)
        {
            const int       ELEMENTOS = 10;
            ElementoBinario serializador;

            byte[] data;
            T[]    arrayDeserializada;
            T[]    array = new T[ELEMENTOS];
            for (int k = 0; k < ELEMENTOS; k++)
            {
                array[k] = getElement();
            }
            serializador       = ElementoBinario.GetSerializador(array.GetType());
            data               = serializador.GetBytes(array);
            arrayDeserializada = (T[])serializador.GetObject(data);
            return(Equals(array, arrayDeserializada));
        }
Ejemplo n.º 4
0
        static bool TestDosDimensiones <T>(GetElement <T> getElement)
        {
            const int ELEMENTOS = 10;

            return(TestAny <T[, ]>(() =>
            {
                T[,] array = new T[ELEMENTOS, ELEMENTOS];
                for (int i = 0; i < ELEMENTOS; i++)
                {
                    for (int j = 0; j < ELEMENTOS; j++)
                    {
                        array[i, j] = getElement();
                    }
                }
                return array;
            }));
        }
Ejemplo n.º 5
0
        /// -------------------------------------------------------------------
        /// <summary></summary>
        /// -----------------------`--------------------------------------------
        private void TSM_MainDialogSettings(
            ActionMethod actionMethod,
            string keyName,
            GetElement subMenu,
            GetElement checkBox,
            WaitTestState callbackCheckBoxIsChecked,
            WaitTestState callbackCheckBoxIsUnChecked,
            CheckType checkType)
        {

            // "Step: Toggle the \"\" menu",
            TS_ToggleMainFormSettingsByMenu(
                ActionMethod.Menu,
                MainForm.ApplicationMenuBar.PreferencesMenu.AutomationElement,
                subMenu,
                callbackCheckBoxIsChecked, callbackCheckBoxIsUnChecked,
                CheckType.Verification);

            HelperPersistKeyNameValuesToTable(_keyNameValuesCurrent);

            // "Step: Close Narrator",
            TS_NarratorClose(ActionMethod.UIAutomation, true, CheckType.Verification);

            // "Step: Restart Narrator",
            TS_NarratorStart(WindowVisualState.Normal, CheckType.Verification);

            // "Step: Verify current \"\" registry setting to previous runs value set",
            // "Step: Verify current \"\" check box setting to previous runs value set",
            // "Step: Verify the ToggleState of the sub menu",
            TS3_VerifyMainFormSetting(keyName, checkBox, MainForm.ApplicationMenuBar.PreferencesMenu.AutomationElement, subMenu, CheckType.Verification);
        }
Ejemplo n.º 6
0
        /// -------------------------------------------------------------------
        /// <summary></summary>
        /// -------------------------------------------------------------------
        private void TS3_VerifyMainFormSetting(string keyName, GetElement checkBox, AutomationElement menu, GetElement subMenu, CheckType checkType)
        {
            Library.ValidateArgumentNonNull(checkBox, "checkBox");
            Library.ValidateArgumentNonNull(menu, "menu");
            Library.ValidateArgumentNonNull(subMenu, "subMenu");

            // "Step: Verify current \"\" registry setting to previous runs value set",
            TS_VerifyRegistryKeyNameValue(keyName, _keyNameValuesCurrent[keyName], checkType);

            // "Step: Verify current \"\" check box setting to previous runs value set",
            TS_VerifyToggleState(checkBox(), keyName, checkType);

            HelperExpandMenuUsingAccessKey(menu, checkType);

            Comment("Find menu : " + subMenu.Method.Name);

            // "Step: Verify the ToggleState of the sub menu",
            TS_VerifyToggleState(subMenu(), keyName, checkType);

        }
Ejemplo n.º 7
0
        /// -------------------------------------------------------------------
        /// <summary></summary>
        /// -------------------------------------------------------------------
        private void TS_ToggleMainFormSettingsByMenu(
            ActionMethod actionMethod,
            AutomationElement menu,
            GetElement subMenu,
            WaitTestState checkBoxOnCallBack,
            WaitTestState checkBoxOffCallBack,
            CheckType checkType)
        {
            switch (actionMethod)
            {
                case ActionMethod.Menu:
                    {
                        HelperExpandMenuUsingAccessKey(menu, checkType);
                        AutomationElement subMenuItem = subMenu();
                        ToggleState ts = GetMenuToggleState(subMenuItem);
                        HelperInvokeMenuItemUsingAccessKey(subMenuItem, CheckType.Verification);


                        if (ts == ToggleState.Off)
                            Wait(checkBoxOnCallBack, _WAIT_NORMAL_MILLISECONDS, checkType);
                        else
                            Wait(checkBoxOffCallBack, _WAIT_NORMAL_MILLISECONDS, checkType);


                    }
                    break;
                default:
                    throw new ArgumentException();
            }


            m_TestStep++;
        }
Ejemplo n.º 8
0
 public GetElementResult(GetElement activity)
 {
     Activity = activity;
 }
 public MyClass(GetElement getElement)
 {
     GetElement = getElement;
 }
Ejemplo n.º 10
0
 public WebBaseElement() : this(By.Id("EMPTY"))
 {
     Invoker    = new ActionInvoker(this);
     GetElement = new GetElement(this);
     Actions    = new ElementsActions(this);
 }