Пример #1
0
        public void RemoveAllTest()
        {
            NuGenTabPage tabPage  = _tabControl.TabPages.Add("");
            NuGenTabPage tabPage2 = _tabControl.TabPages.Add("");

            _eventSink.ExpectedTabPageRemoved = 2;

            _eventSink.AddExpectedTabPageRemovedIndex(1);
            _eventSink.AddExpectedTabPageRemovedIndex(0);

            _eventSink.AddExpectedTabPageRemovedObject(tabPage2);
            _eventSink.AddExpectedTabPageRemovedObject(tabPage);

            _tabControl.TabPages.Remove(tabPage2);
            Assert.AreEqual(1, _tabControl.TabButtons.Count);
            Assert.IsNotNull(_tabControl.SelectedTabButton);

            _tabControl.TabPages.Remove(tabPage);
            Assert.AreEqual(0, _tabControl.TabButtons.Count);
            Assert.IsNull(_tabControl.SelectedTabButton);

            _eventSink.Verify();
        }