Exemplo n.º 1
0
        public void httpcontext_header_variables()
        {
            var tempContext = new MockHttpContext();
            tempContext.HeaderVariables.Add("Authorization","BASIC abcdefghijklmnop==");

            HttpContextFactory.SetCurrentContext(tempContext.Context);

            //TODO: call http method
            //TODO: asserts
        }
Exemplo n.º 2
0
        public void httpcontext_cookies()
        {
            var tempContext = new MockHttpContext();
            tempContext.Cookies.Add(new HttpCookie("myCookie","abcd"));

            HttpContextFactory.SetCurrentContext(tempContext.Context);

            //TODO: call http method
            //TODO: asserts
        }
Exemplo n.º 3
0
        public void httpcontext_session()
        {
            var tempContext = new MockHttpContext();
            HttpContextFactory.SetCurrentContext(tempContext.Context);

            HttpContextFactory.Current.Session["testid"] = "test data";

            //TODO: call http method under test

            Assert.AreEqual("test data", HttpContextFactory.Current.Session["testid"]);
        }
Exemplo n.º 4
0
        public void httpcontext_server_variables()
        {
            var tempContext = new MockHttpContext();
            tempContext.ServerVariables.Add("REMOTE_ADDR", "127.0.0.1");
            tempContext.ServerVariables.Add("HTTP_USER_AGENT", "user agent string here");
            tempContext.ServerVariables.Add("HTTP_X_FORWARDED_FOR", "12.13.14.15");

            HttpContextFactory.SetCurrentContext(tempContext.Context);

            //TODO: call http method
            //TODO: asserts
        }