Browse Source

Added extra TabControl test.

Steven Kirk 10 years ago
parent
commit
5a40e57f2b
1 changed files with 5 additions and 0 deletions
  1. 5 0
      tests/Perspex.Controls.UnitTests/TabControlTests.cs

+ 5 - 0
tests/Perspex.Controls.UnitTests/TabControlTests.cs

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