public void ControlTypeCondition() { Assert.AreEqual("ControlType=button", SearchConditionFactory.CreateForControlType(typeof(Button)).ToString()); Assert.AreEqual("ControlType=pane", SearchConditionFactory.CreateForControlType(typeof(TestCustomUIItem)).ToString()); Assert.AreEqual("ControlType=menu bar", SearchConditionFactory.CreateForControlType(typeof(MenuBar), Constants.WinFormFrameworkId).ToString()); Assert.AreEqual("ControlType=menu", SearchConditionFactory.CreateForControlType(typeof(MenuBar), Constants.WPFFrameworkId).ToString()); }
public void Create() { Assert.That(SearchConditionFactory.CreateForControlType(element.Current.ControlType).AppliesTo(element), Is.True); Assert.That(SearchConditionFactory.CreateForAutomationId(element.Current.AutomationId).AppliesTo(element), Is.True); Assert.That(SearchConditionFactory.CreateForFrameworkId(element.Current.FrameworkId).AppliesTo(element), Is.True); Assert.That(SearchConditionFactory.CreateForClassName(element.Current.ClassName).AppliesTo(element), Is.True); }
public void ControlTypeCondition() { Assert.Equal("(ControlType=button or ControlType=check box)", SearchConditionFactory.CreateForControlType(typeof(Button), WindowsFramework.Wpf).ToString()); Assert.Equal("ControlType=pane", SearchConditionFactory.CreateForControlType(typeof(TestCustomUIItem), WindowsFramework.Wpf).ToString()); Assert.Equal("ControlType=menu bar", SearchConditionFactory.CreateForControlType(typeof(MenuBar), WindowsFramework.WinForms).ToString()); Assert.Equal("ControlType=menu", SearchConditionFactory.CreateForControlType(typeof(MenuBar), WindowsFramework.Wpf).ToString()); }
public void ControlTypeCondition() { Assert.That(SearchConditionFactory.CreateForControlType(typeof(Button), WindowsFramework.Wpf).ToString(), Is.EqualTo(String.Format("(ControlType={0} or ControlType={1})", ControlType.Button, ControlType.CheckBox))); Assert.That(SearchConditionFactory.CreateForControlType(typeof(TestCustomUIItem), WindowsFramework.Wpf).ToString(), Is.EqualTo(String.Format("ControlType={0}", ControlType.Pane))); Assert.That(SearchConditionFactory.CreateForControlType(typeof(MenuBar), WindowsFramework.WinForms).ToString(), Is.EqualTo(String.Format("ControlType={0}", ControlType.MenuBar))); Assert.That(SearchConditionFactory.CreateForControlType(typeof(MenuBar), WindowsFramework.Wpf).ToString(), Is.EqualTo(String.Format("ControlType={0}", ControlType.Menu))); }
public void ControlTypeCondition() { Assert.Equal(string.Format("(ControlType={0} or ControlType={1})", ControlType.Button.LocalizedControlType, ControlType.CheckBox.LocalizedControlType), SearchConditionFactory.CreateForControlType(typeof(Button), WindowsFramework.Wpf).ToString()); Assert.Equal(string.Format("ControlType={0}", ControlType.Pane.LocalizedControlType), SearchConditionFactory.CreateForControlType(typeof(TestCustomUIItem), WindowsFramework.Wpf).ToString()); Assert.Equal(string.Format("ControlType={0}", ControlType.MenuBar.LocalizedControlType), SearchConditionFactory.CreateForControlType(typeof(MenuBar), WindowsFramework.WinForms).ToString()); Assert.Equal(string.Format("ControlType={0}", ControlType.Menu.LocalizedControlType), SearchConditionFactory.CreateForControlType(typeof(MenuBar), WindowsFramework.Wpf).ToString()); }