diff --git a/src/TestApplications/WpfTestApplication/MainWindow.xaml b/src/TestApplications/WpfTestApplication/MainWindow.xaml index 9050d34a..a3f56a02 100644 --- a/src/TestApplications/WpfTestApplication/MainWindow.xaml +++ b/src/TestApplications/WpfTestApplication/MainWindow.xaml @@ -81,7 +81,20 @@ - + + + + + + + + + + + + + + diff --git a/src/TestApplications/WpfTestApplication/MainWindow.xaml.cs b/src/TestApplications/WpfTestApplication/MainWindow.xaml.cs index 3ab913ed..13357902 100644 --- a/src/TestApplications/WpfTestApplication/MainWindow.xaml.cs +++ b/src/TestApplications/WpfTestApplication/MainWindow.xaml.cs @@ -12,17 +12,50 @@ namespace WpfTestApplication public partial class MainWindow { private bool controlsDisabled; + private readonly ObservableCollection states = new ObservableCollection(); public MainWindow() { DataContext = this; + InitializeComponent(); + var treeViewItem = new TreeViewItem { Header = "Lots Of Children" }; foreach (var i in Enumerable.Range(1, 50)) { treeViewItem.Items.Add(new TreeViewItem { Header = "Child" + i }); } + TreeView.Items.Add(treeViewItem); + + states.Add(new State() + { + Id = "1", + Contents = "Item1", + Description = "Simple item 1", + ComboboxItems = new ObservableCollection(DataGridComboboxItems) + }); + + states.Add(new State() + { + Id = "2", + Contents = "Item2", + Description = "", + ComboboxItems = new ObservableCollection(DataGridComboboxItems) + }); + + states.Add(new State() + { + Id = "3", + Contents = "Item3", + Description = "", + ComboboxItems = new ObservableCollection(DataGridComboboxItems) + }); + } + + public ObservableCollection States + { + get { return states; } } public ObservableCollection ListItems @@ -159,16 +192,34 @@ private void ClickMe_OnClick(object sender, RoutedEventArgs e) AutomationProperties.SetHelpText(this, "Click Me Clicked"); } - public TestItem[] TestItems + public string[] DataGridComboboxItems { - get + get { - return new[]{ - new TestItem {Id = 1, Contents = "Item1", Description = "Simple item 1"}, - new TestItem {Id = 2, Contents = "Item2", Description = ""}, - new TestItem {Id = 3, Contents = "Item3"} - }; + return new[] + { + "Item1", + "Item2", + "Item3", + "Item4" + }; } + + } + + public class State + { + public string Id + { get; set; } + + public string Contents + { get; set; } + + public string Description + { get; set; } + + public ObservableCollection ComboboxItems + { get; set; } } } } diff --git a/src/TestApplications/WpfTestApplication/TestItem.cs b/src/TestApplications/WpfTestApplication/TestItem.cs deleted file mode 100644 index 1906ae82..00000000 --- a/src/TestApplications/WpfTestApplication/TestItem.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace WpfTestApplication -{ - public class TestItem - { - public int Id { get; set; } - public string Contents { get; set; } - public string Description { get; set; } - } -} diff --git a/src/TestApplications/WpfTestApplication/WpfTestApplication.csproj b/src/TestApplications/WpfTestApplication/WpfTestApplication.csproj index e9540215..25ad1f82 100644 --- a/src/TestApplications/WpfTestApplication/WpfTestApplication.csproj +++ b/src/TestApplications/WpfTestApplication/WpfTestApplication.csproj @@ -123,7 +123,6 @@ HorizontalGridSplitter.xaml - ListControls.xaml diff --git a/src/TestStack.White.UITests/ControlTests/DataGridTests.cs b/src/TestStack.White.UITests/ControlTests/DataGridTests.cs index 683bfeda..acd3e92a 100644 --- a/src/TestStack.White.UITests/ControlTests/DataGridTests.cs +++ b/src/TestStack.White.UITests/ControlTests/DataGridTests.cs @@ -32,7 +32,7 @@ void CanGetAllItemsWpf() var rows = DataGridWpfUnderTest.Rows; Assert.Equal(3, rows.Count); var row1 = rows.Get(0); - Assert.Equal(3, row1.Cells.Count); + Assert.Equal(4, row1.Cells.Count); Assert.Equal("1", row1.Cells[0].Text); Assert.Equal("Item1", row1.Cells[1].Text); Assert.Contains("Simple", row1.Cells[2].Text);