Пример #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
        }
Пример #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
        }
Пример #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"]);
        }
Пример #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
        }