public void OnUnselected() { TabControl tab_control = new TabControl(); OnUnselectedTabItem i1 = new OnUnselectedTabItem(); tab_control.Items.Add(i1); OnUnselectedTabItem i2 = new OnUnselectedTabItem(); tab_control.Items.Add(i2); i1.IsSelected = true; Assert.AreEqual(tab_control.SelectedIndex, 0, "1"); Assert.IsTrue(i1.IsSelected, "1 1"); i2.IsSelected = true; Assert.AreEqual(tab_control.SelectedIndex, 1, "2"); Assert.IsFalse(i1.IsSelected, "3"); Assert.IsTrue(i2.IsSelected, "4"); }
public void OnUnselected () { TabControl tab_control = new TabControl (); OnUnselectedTabItem i1 = new OnUnselectedTabItem (); tab_control.Items.Add (i1); OnUnselectedTabItem i2 = new OnUnselectedTabItem (); tab_control.Items.Add (i2); i1.IsSelected = true; Assert.AreEqual (tab_control.SelectedIndex, 0, "1"); Assert.IsTrue (i1.IsSelected, "1 1"); i2.IsSelected = true; Assert.AreEqual (tab_control.SelectedIndex, 1, "2"); Assert.IsFalse (i1.IsSelected, "3"); Assert.IsTrue (i2.IsSelected, "4"); }