public static void EvaluateSession(Page p)
        {
            SessionParameterPoker sessionParam = new SessionParameterPoker();

            sessionParam.SessionField = "key";
            sessionParam.Type         = TypeCode.String;
            TextBox tb = new TextBox();

            p.Controls.Add(tb);
            string value = (string)sessionParam.DoEvaluate(HttpContext.Current, tb);

            Assert.AreEqual("Key1", value, "EvaluateSessionParameter");
        }
        public void SessionParameter_Evaluate()
        {
            SessionParameterPoker sessionParam = new SessionParameterPoker("employee", TypeCode.String, "id");
            Button b     = new Button();
            string value = (string)sessionParam.DoEvaluate(null, b);

            Assert.AreEqual(null, value, "EvaluateSessionWhenNullContext");
            WebTest       t  = new WebTest();
            PageDelegates pd = new PageDelegates();

            pd.Init   = InitSesssion;
            pd.Load   = EvaluateSession;
            t.Invoker = new PageInvoker(pd);
            string html = t.Run();

            WebTest.Unload();
        }
Ejemplo n.º 3
0
		public static void EvaluateSession(Page p)
		{
			SessionParameterPoker sessionParam = new SessionParameterPoker();
			sessionParam.SessionField = "key";
			sessionParam.Type = TypeCode.String;
			TextBox tb = new TextBox();
			p.Controls.Add(tb); 
			string value = (string)sessionParam.DoEvaluate(HttpContext.Current, tb);
			Assert.AreEqual("Key1", value, "EvaluateSessionParameter");
		}
Ejemplo n.º 4
0
		public void SessionParameter_Evaluate()
		{
			SessionParameterPoker sessionParam = new SessionParameterPoker("employee",TypeCode.String ,"id") ;
			Button b = new Button();
			string value = (string)sessionParam.DoEvaluate(null, b);
			Assert.AreEqual(null, value, "EvaluateSessionWhenNullContext");
			WebTest t = new WebTest();
			PageDelegates pd = new PageDelegates();
			pd.Init = InitSesssion;
			pd.Load = EvaluateSession;
			t.Invoker = new PageInvoker(pd);
			string html = t.Run();
			WebTest.Unload(); 
			

		}