UiaAtkBridgeTest.AtkTests.ListView C# (CSharp) Method

ListView() private method

private ListView ( ) : void
return void
		public void ListView ()
		{
			BasicWidgetType type = BasicWidgetType.ListView;
			Atk.Object accessible;

			accessible = GetAccessible (type, simpleTable, true);
			ExpandTreeView (accessible);

			// A group cannot be selected, so exclude names of
			// groups from selection test
			string[] names = NamesFromTableXml (simpleTable, 1);
			Atk.ISelection atkSelection = CastToAtkInterface <Atk.ISelection> (accessible);
			InterfaceSelection (atkSelection, names, accessible, type);
			
			string name = "<table><th><td>Title</td><td>Author</td><td>year</td></th>"+
				"<tr><td>Non-C#</td>"+
				"<tr><td>Programming Windows</td><td>Petzold, Charles</td><td>1998</td></tr>"+
				"<tr><td>Code: The Hidden Language of Computer Hardware and Software</td><td>Petzold, Charles</td><td>2000</td></tr>"+
				"<tr><td>Coding Techniques for Microsoft Visual Basic .NET</td><td>Connell, John</td><td>2001</td></tr>"+
				"</tr><tr><td>C#</td>"+
				"<tr><td>Programming Windows with C#</td><td>Petzold, Charles</td><td>2001</td></tr>"+
				"<tr><td>C# for Java Developers</td><td>Jones, Allen &amp; Freeman, Adam</td><td>2002</td></tr>"+
				"</tr></table>";
			accessible = GetAccessible (type, name, true);
			
			Atk.IComponent atkComponent = CastToAtkInterface <Atk.IComponent> (accessible);
			InterfaceComponent (type, atkComponent);
			
			States (accessible,
			  Atk.StateType.Enabled,
			  Atk.StateType.Focusable,
			  Atk.StateType.ManagesDescendants,
			  Atk.StateType.Sensitive,
			  Atk.StateType.Showing,
			  Atk.StateType.Visible);

			PropertyRole (type, accessible);

			Atk.ITable atkTable = CastToAtkInterface<Atk.ITable> (accessible);
			Assert.AreEqual (ValidNChildrenForAListView, accessible.NAccessibleChildren, "ListView numChildren");
			Atk.Object header = FindObjectByRole (accessible, Atk.Role.TableColumnHeader);
			Assert.IsNotNull (header, "Header not null");
			States (header,
			    Atk.StateType.Selectable,
				Atk.StateType.Enabled,
				Atk.StateType.Sensitive,
				Atk.StateType.Showing,
				Atk.StateType.Visible);
			Atk.IAction action = CastToAtkInterface<Atk.IAction> (header);
			InterfaceAction (BasicWidgetType.HeaderItem, action, header);

			Atk.Object child1 = FindObjectByName (accessible, "Programming Windows with C#");
			int child1Index = child1.IndexInParent;
			Assert.IsTrue (child1Index >= 0, "Child 1 index > 0");
			InterfaceText (child1, "Programming Windows with C#");
			Assert.IsNotNull (child1, "FindObjectByName #1");
			Assert.AreEqual (Atk.Role.TableCell, child1.Role, "Child 1 role");
			Atk.Object group = FindObjectByName (accessible, "C#");
			int groupIndex = group.IndexInParent;
			Assert.IsTrue (groupIndex >= 0, "Group index > 0");
			Assert.IsFalse (child1Index == groupIndex, "Child should have a different index from its group");

			InterfaceText (group, "C#");

			Relation (Atk.RelationType.NodeChildOf, child1, group);

			//FIXME: replace the code below with just a call to InterfaceTable()
			Assert.AreEqual (3, atkTable.NColumns, "Table NumColumns");
		}