Ejemplo n.º 1
0
        [Test]        //[Ignore("Temporary for the sake of NUnit 2.2")]
        public void ItemCountOfListSubMenu()
        {
            ITestableUIAdapter adapter = (ITestableUIAdapter)m_window.MenuAdapter;

            Assert.AreEqual(adapter.GetItemCountOfGroup("SubVowels"), 5);
            //CheckSubMenuCount("Type", "Vowels",5);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// perform a click on the first MenuItem with this id (or label).
        /// </summary>
        /// <remarks> this will perform the clicked even if the menu item is disabled!
        /// so it is not a test of the display properties polling system.</remarks>
        /// <param name="id"></param>
        protected void ClickMenuItem(string groupId, string itemId)
        {
            //FindMenuItem(id).PerformClick();
            //object widget = FindWidgetForItem(id);

            ITestableUIAdapter adapter = (ITestableUIAdapter)m_window.MenuAdapter;

            adapter.ClickItem(groupId, itemId);
        }
Ejemplo n.º 3
0
        public void VisitAllMenus()
        {
            if (m_window.Mediator == null)
            {
                ReopenWindow();                 // A previously run test had closed it, so the mediator was gone.
            }
            ITestableUIAdapter adapter = (ITestableUIAdapter)m_window.MenuAdapter;

            adapter.ClickOnEverything();
        }
Ejemplo n.º 4
0
        [Test]        //[Ignore("Temporary for the sake of NUnit 2.2")]
        public void VisitAllMenus()
        {
            if (m_window.Mediator == null)
            {
                ReopenWindow();                 // A previously run test had closed it, so the mediator was gone.
            }
            ITestableUIAdapter adapter = (ITestableUIAdapter)m_window.MenuAdapter;

            adapter.ClickOnEverything();

            //			foreach(MenuItem menu in m_window.Menu.MenuItems)
            //			{
            //				VisitMenu(menu);
            //			}
        }
Ejemplo n.º 5
0
        public void ZCreateUIfromStream()
        {
            Assembly assembly = Assembly.GetExecutingAssembly();

            System.IO.Stream stream =
                assembly.GetManifestResourceStream("XCore.basicTest.xml");
            Assert.IsNotNull(stream, "Couldn't get the XML file.");

            XCore.XWindow window = new XWindow();
            window.LoadUI(stream);

            ITestableUIAdapter adapter = (ITestableUIAdapter)window.MenuAdapter;

            Assert.AreEqual(adapter.GetItemCountOfGroup("Vowels"), 5);
        }
Ejemplo n.º 6
0
        public void ZDynamicallyModifyListGroup()
        {
            ITestableUIAdapter adapter = (ITestableUIAdapter)m_window.MenuAdapter;

            TesterControl.cbModifyVowelList.Checked = false;
            //			MenuItem menu =FindMenu("Vowels");
            //			menu.PerformClick();//cause the polling of the display properties
            //			MenuItem item =FindMenuItem("OO");		//this item should not be there yet
            //			Assert.IsTrue(item == null,"The extra Vowels are not supposed to be there yet. the list should revert to what is in the XML configuration if no colleagues modifies it.");
            Assert.IsFalse(adapter.HasItem("Vowels", "OO"), "The extra Vowels are not supposed to be there yet. the list should revert to what is in the XML configuration if no colleagues modifies it.");

            TesterControl.cbModifyVowelList.Checked = true;
            //			menu.PerformClick();//cause the polling of the display properties
            //			item =FindMenuItem("OO");		//make sure one of the new items was added
            //			Assert.IsTrue(item != null,"The extra Vowels do not seem to have been added");
            Assert.IsTrue(adapter.HasItem("Vowels", "OO"), "The extra Vowels do not seem to have been added");
        }
Ejemplo n.º 7
0
        [Test]        //[Ignore("Temporary for the sake of NUnit 2.2")]
        public void EnableDisableCommandMenuItem()
        {
            ITestableUIAdapter adapter = (ITestableUIAdapter)m_window.MenuAdapter;

            Assert.IsFalse(adapter.IsItemEnabled("Misc", "enableTest"), "The 'enable test' item should have been disabled");

            //the tester control will disable this item,when it is polled,
            //	if this check box is not checked
            //			TesterControl.cbEnableTest.Checked = false;
            //			MenuItem menu =FindMenu("Misc");
            //			menu.PerformClick();//cause the polling of the display properties of each of the items
            //			MenuItem item =FindMenuItem("enableTest");
            //			Assert.IsFalse(item.Enabled,"The 'enable test' item should have been disabled");

            //now enable it
            TesterControl.cbEnableTest.Checked = true;
            //			menu.PerformClick();//cause the polling of the display properties of each of the items
            //			//this will actually be a new MenuItem as it is re-created each time
            //			item =FindMenuItem("enableTest");
            //			Assert.IsTrue (item.Enabled,"The 'enable test' item should have been enabled");

            Assert.IsTrue(adapter.IsItemEnabled("Misc", "enableTest"), "The 'enable test' item should have been emabled");
        }
Ejemplo n.º 8
0
        [Test]        //[Ignore("Temporary for the sake of NUnit 2.2")]
        public void ConfigurationInclude()
        {
            ITestableUIAdapter adapter = (ITestableUIAdapter)m_window.MenuAdapter;

            Assert.IsTrue(adapter.HasItem("DebugMenu", "ClearFields"));
        }
Ejemplo n.º 9
0
        /// <summary>
        /// perform a click on the first MenuItem with this id (or label).
        /// </summary>
        /// <remarks> this will perform the clicked even if the menu item is disabled!
        /// so it is not a test of the display properties polling system.</remarks>
        /// <param name="id"></param>
        protected void ClickMenuItem(string groupId, string itemId)
        {
            ITestableUIAdapter adapter = (ITestableUIAdapter)m_window.MenuAdapter;

            adapter.ClickItem(groupId, itemId);
        }