UiaAtkBridgeTest.AtkTests.Button C# (CSharp) Method

Button() private method

private Button ( ) : void
return void
		public void Button ()
		{
			BasicWidgetType type = BasicWidgetType.NormalButton;

			string name = "test test";
			Atk.Object accessible = GetAccessible (type, name);

			Interfaces (accessible,
			            typeof (Atk.IComponent),
			            typeof (Atk.IImage),
			            typeof (Atk.IAction),
			            typeof (Atk.IText));
			
			States (accessible,
			  Atk.StateType.Enabled,
			  Atk.StateType.Focusable,
			  Atk.StateType.Sensitive,
			  Atk.StateType.Showing,
			  Atk.StateType.Visible);

			Atk.IComponent atkComponent = CastToAtkInterface <Atk.IComponent> (accessible);
			InterfaceComponent (type, atkComponent);

			Atk.IAction atkAction = CastToAtkInterface <Atk.IAction> (accessible);
			InterfaceAction (type, atkAction, accessible);

			InterfaceText (type);

			PropertyRole (type, accessible);

			Assert.AreEqual (0, accessible.NAccessibleChildren, "Button numChildren");

			Parent (type, accessible);

			//test with an image
			Atk.IImage atkWithOutImage, atkWithImage;
			accessible = GetAccessible (type, name, true);
			atkWithOutImage = CastToAtkInterface <Atk.IImage> (accessible);
			accessible = GetAccessibleThatEmbedsAnImage (type, name, true);
			atkWithImage = CastToAtkInterface <Atk.IImage> (accessible);
			atkComponent = CastToAtkInterface<Atk.IComponent> (accessible);
			InterfaceImage (type, atkWithImage, atkComponent, atkWithOutImage);

			//Key Binding tests
			name = "t_est";
			accessible = GetAccessible (type, name, true);
			Assert.IsNull (atkAction.GetKeybinding (-1), "GetKeybinding (-1))");
			Assert.IsNull (atkAction.GetKeybinding (1), "GetKeybinding (1))");
			string keyBinding = atkAction.GetKeybinding (0);
			Assert.IsNotNull (keyBinding, "GetKeybinding (0))");
			Assert.AreEqual (keyBinding, "<Alt>e", "<Alt>e");
		}