Browse Source

Added extra TabControl test.

pull/223/head
Steven Kirk 11 years ago
parent
commit
5a40e57f2b
  1. 5
      tests/Perspex.Controls.UnitTests/TabControlTests.cs

5
tests/Perspex.Controls.UnitTests/TabControlTests.cs

@ -139,6 +139,7 @@ namespace Perspex.Controls.UnitTests
new Item("Bar"), new Item("Bar"),
new TextBlock { Text = "Baz" }, new TextBlock { Text = "Baz" },
new TabItem { Content = "Qux" }, new TabItem { Content = "Qux" },
new TabItem { Content = new TextBlock { Text = "Bob" } }
}; };
var target = new TabControl var target = new TabControl
@ -168,6 +169,10 @@ namespace Perspex.Controls.UnitTests
target.SelectedIndex = 3; target.SelectedIndex = 3;
dataContext = ((TextBlock)target.GetLogicalChildren().Single()).DataContext; dataContext = ((TextBlock)target.GetLogicalChildren().Single()).DataContext;
Assert.Equal("Qux", dataContext); Assert.Equal("Qux", dataContext);
target.SelectedIndex = 4;
dataContext = ((TextBlock)target.GetLogicalChildren().Single()).DataContext;
Assert.Equal("Base", dataContext);
} }
private Control CreateTabControlTemplate(TabControl parent) private Control CreateTabControlTemplate(TabControl parent)

Loading…
Cancel
Save