Ejemplo n.º 1
0
 void CanGetCell(ListView dataGridUnderTest)
 {
     var cell = dataGridUnderTest.Cell("Contents", 0);
     Assert.AreEqual("Item1", cell.Text);
     Assert.AreEqual("Item2", dataGridUnderTest.Cell("Contents", 1).Text);
     Assert.AreEqual("Item3", dataGridUnderTest.Cell("Contents", 2).Text);
 }
Ejemplo n.º 2
0
 void CanGetAllItems(ListView dataGridUnderTest)
 {
     var rows = dataGridUnderTest.Rows;
     Assert.AreEqual(3, rows.Count);
     var row1 = rows.Get(0);
     Assert.AreEqual(3, row1.Cells.Count);
     Assert.AreEqual("1", row1.Cells[0].Text);
     Assert.AreEqual("Item1", row1.Cells[1].Text);
     StringAssert.Contains("Simple", row1.Cells[2].Text);
 }
Ejemplo n.º 3
0
        protected override void RunTest(WindowsFramework framework)
        {
            DataGridUnderTest = MainWindow.Get<ListView>(SearchCriteria.ByAutomationId("DataGridControl"));
            var customControl = MainWindow.Get(SearchCriteria.ByAutomationId("CustomDataGridControl")) as UIItem;
            DataGridFromCustomControlUnderTest = customControl.Get<ListView>(SearchCriteria.ByAutomationId("DataGridControl"));

            RunTest(() => CanGetAllItems(DataGridUnderTest));
            RunTest(() => CanGetAllItems(DataGridFromCustomControlUnderTest));
            RunTest(() => CanGetCell(DataGridUnderTest));
            RunTest(() => CanGetCell(DataGridFromCustomControlUnderTest));
        }
Ejemplo n.º 4
0
 public static UserEvent Create(ListView listView, AutomationPropertyChangedEventArgs eventArgs)
 {
     var columnPosition = (int) Mouse.instance.Location.X;
     if (listView.SelectedRows.Count == 0)
     {
         var listViewEvent = new ListViewEvent(listView, TryUnSelectAll, new object[] {});
         return listViewEvent;
     }
     if (true.Equals(eventArgs.NewValue))
     {
         string column = null;
         if (listView.Header != null)
         {
             ListViewColumn listViewColumn =
                 listView.Header.Columns.Find(obj => obj.Bounds.Left < columnPosition && columnPosition < obj.Bounds.Right);
             column = listViewColumn.Text;
         }
         string value = column == null ? listView.SelectedRows[0].Cells[0].Text : listView.SelectedRows[0].Cells[column].Text;
         return new ListViewEvent(listView, Select, new object[] {column, value});
     }
     return null;
 }
Ejemplo n.º 5
0
 protected override void TestFixtureSetUp()
 {
     listView = window.Get<ListView>("listView");
 }
 public void SetUp()
 {
     listView = window.Get<ListView>("listView");
 }