Example #1
0
        // Tests Save/Load/Track ViewState
        public void ViewState()
        {
            ListControlPoker a = new ListControlPoker();
            ListControlPoker b = new ListControlPoker();

            a.TrackState();

            BeginIndexChanged(a);
            BeginIndexChanged(b);

            a.Items.Add("a");
            a.Items.Add("b");
            a.Items.Add("c");
            a.SelectedIndex = 2;

            object state = a.SaveState();

            b.LoadState(state);

            Assert.AreEqual(2, b.SelectedIndex, "A1");
            Assert.AreEqual(b.Items.Count, 3, "A2");

            Assert.AreEqual(b.Items [0].Value, "a", "A3");
            Assert.AreEqual(b.Items [1].Value, "b", "A4");
            Assert.AreEqual(b.Items [2].Value, "c", "A5");

            Assert.IsFalse(EndIndexChanged(a), "A6");
            Assert.IsFalse(EndIndexChanged(b), "A7");
        }
Example #2
0
        // Tests Save/Load/Track ViewState
        public void ViewStateIsNeeded()
        {
            ListControlPoker a  = new ListControlPoker();
            IStateManager    sm = a.Items as IStateManager;

            Assert.IsFalse(a.GetIsTrackingViewState(), "#A1-1");
            Assert.IsFalse(sm.IsTrackingViewState, "#A1-2");
            object state = a.SaveState();

            Assert.IsNotNull(state, "#A1-3");

            a.Items.Add("a");
            a.Items.Add("b");
            a.Items.Add("c");

            Assert.IsFalse(a.GetIsTrackingViewState(), "#A2-1");
            Assert.IsFalse(sm.IsTrackingViewState, "#A2-2");

            state = a.SaveState();
            Assert.IsNotNull(state, "#A3");
        }
Example #3
0
        // Tests Save/Load/Track ViewState
        public void ViewStateNotNeeded()
        {
            ListControlPoker a = new ListControlPoker();

            a.Items.Add("a");
            a.Items.Add("b");
            a.Items.Add("c");

            object state = a.SaveState();

            Assert.AreEqual(null, state, "A1");
        }
Example #4
0
		// Tests Save/Load/Track ViewState
		public void ViewStateIsNeeded ()
		{
			ListControlPoker a = new ListControlPoker ();
			IStateManager sm = a.Items as IStateManager;
			
			Assert.IsFalse (a.GetIsTrackingViewState (), "#A1-1");
			Assert.IsFalse (sm.IsTrackingViewState, "#A1-2");
			object state = a.SaveState ();
			Assert.IsNotNull (state, "#A1-3");

			a.Items.Add ("a");
			a.Items.Add ("b");
			a.Items.Add ("c");

			Assert.IsFalse (a.GetIsTrackingViewState (), "#A2-1");
			Assert.IsFalse (sm.IsTrackingViewState, "#A2-2");

			state = a.SaveState ();
			Assert.IsNotNull (state, "#A3");
		}
Example #5
0
		// Tests Save/Load/Track ViewState
		public void ViewState ()
		{
			ListControlPoker a = new ListControlPoker ();
			ListControlPoker b = new ListControlPoker ();

			a.TrackState ();

			BeginIndexChanged (a);
			BeginIndexChanged (b);

			a.Items.Add ("a");
			a.Items.Add ("b");
			a.Items.Add ("c");
			a.SelectedIndex = 2;

			object state = a.SaveState ();
			b.LoadState (state);

			Assert.AreEqual (2, b.SelectedIndex, "A1");
			Assert.AreEqual (b.Items.Count, 3, "A2");

			Assert.AreEqual (b.Items [0].Value, "a", "A3");
			Assert.AreEqual (b.Items [1].Value, "b", "A4");
			Assert.AreEqual (b.Items [2].Value, "c", "A5");

			Assert.IsFalse (EndIndexChanged (a), "A6");
			Assert.IsFalse (EndIndexChanged (b), "A7");
		}
		// Tests Save/Load/Track ViewState
		public void ViewStateNotNeeded ()
		{
			ListControlPoker a = new ListControlPoker ();

			a.Items.Add ("a");
			a.Items.Add ("b");
			a.Items.Add ("c");

			object state = a.SaveState ();
			Assert.AreEqual (null, state, "A1");
		}