public void ViewState ()
    {
        Poker p = new Poker ();
        Poker copy = new Poker ();

        p.DataSourceID = "hi";
        object state = p.SaveState ();
        copy.LoadState (state);

        Assert.AreEqual ("hi", copy.DataSourceID, "A1");
    }
Example #2
0
		public void Label_ViewState ()
		{
			Poker p = new Poker ();
			p.TrackState ();

			Assert.AreEqual (p.Text, "", "A1");
			p.Text = "Hello";
			Assert.AreEqual (p.Text, "Hello", "A2");

			object state = p.SaveState ();

			Poker copy = new Poker ();
			copy.TrackState ();
			copy.LoadState (state);
			Assert.AreEqual (copy.Text, "Hello", "A3");
		}
        public void ChildControlViewstate()
        {
            Poker l = MakeNested();

            l.TrackState();
            l.Text = "Hello";

            object o = l.SaveState();

            l = MakeNested();
            l.TrackState();
            l.LoadState(o);

            Assert.AreEqual("<a>Hello</a>", l.Render());
            Assert.AreEqual("Hello", l.Text);
            Assert.IsFalse(l.HasControls());
        }
        public void TestValidationGroup()
        {
            Poker p = new Poker();

            p.TrackState();

            Assert.AreEqual(p.ValidationGroup, "", "V1");
            p.ValidationGroup = "VG1";
            Assert.AreEqual(p.ValidationGroup, "VG1", "V2");

            object state = p.SaveState();

            Poker copy = new Poker();

            copy.TrackState();
            copy.LoadState(state);
            Assert.AreEqual(copy.ValidationGroup, "VG1", "A3");
        }
        public void ViewState()
        {
            Poker p = new Poker();

            p.TrackState();

            Assert.AreEqual(p.Text, "", "A1");
            p.Text = "Hello";
            Assert.AreEqual(p.Text, "Hello", "A2");

            object state = p.SaveState();

            Poker copy = new Poker();

            copy.TrackState();
            copy.LoadState(state);
            Assert.AreEqual(copy.Text, "Hello", "A3");
        }
Example #6
0
        public void ViewState()
        {
            Poker t = new Poker();

            t.TrackState();

            t.ValidationGroup  = "VG";
            t.CausesValidation = true;

            object s = t.SaveState();

            Console.WriteLine("state = {0}", s == null ? "null" : "not-null");

            Poker copy = new Poker();

            copy.LoadState(s);

            Assert.AreEqual("VG", copy.ValidationGroup, "A1");
            Assert.IsTrue(copy.CausesValidation, "A2");
        }
		public void FormView_ViewState ()
		{
			Poker fv = new Poker ();
			Poker copy = new Poker ();
			fv.AllowPaging = true;
			fv.HeaderText = "Testing";
			fv.CssClass = "style.css";
			object state = fv.SaveState ();
			copy.LoadState (state);
			Assert.AreEqual (true, copy.AllowPaging, "ViewStateAllowPaging");
			Assert.AreEqual ("Testing", copy.HeaderText, "ViewStateHeaderText");
			Assert.AreEqual ("style.css", copy.CssClass, "ViewStateCssClass");
		}
		public void ViewState ()
		{
			Poker p = new Poker ();
			Poker copy = new Poker ();

			p.DataSourceID = "hi";
			object state = p.SaveState ();
			copy.LoadState (state);

			Assert.AreEqual ("hi", copy.DataSourceID, "A1");
		}
		public void ViewState ()
		{
			Poker t = new Poker ();

			t.TrackState();

			t.ValidationGroup = "VG";
			t.CausesValidation = true;

			object s = t.SaveState ();
			Console.WriteLine ("state = {0}", s == null ? "null" : "not-null");

			Poker copy = new Poker ();

			copy.LoadState (s);

			Assert.AreEqual ("VG", copy.ValidationGroup, "A1");
			Assert.IsTrue (copy.CausesValidation, "A2");
		}
Example #10
0
		public void TestValidationGroup ()
		{
			Poker p = new Poker ();
			p.TrackState ();

			Assert.AreEqual (p.ValidationGroup, "", "V1");
			p.ValidationGroup = "VG1";
			Assert.AreEqual (p.ValidationGroup, "VG1", "V2");

			object state = p.SaveState ();

			Poker copy = new Poker ();
			copy.TrackState ();
			copy.LoadState (state);
			Assert.AreEqual (copy.ValidationGroup, "VG1", "A3");
		}