예제 #1
0
 /// <summary>
 /// Constructor
 /// </summary>       
 /// <param name="PrincipalToSet">Principal</param>
 /// <param name="RequestToSet">Request to mock</param>
 /// <param name="ResponseToSet">Response to mock</param>
 /// <param name="SessionStateToSet">Mocked session state</param>
 public MockHttpContext(MockPrincipal PrincipalToSet,
                        MockHttpRequest RequestToSet,
                        MockHttpResponse ResponseToSet,
                        MockHttpSessionState SessionStateToSet)
 {
     Principal = PrincipalToSet;
     MockedSessionState = SessionStateToSet;
     MockedHttpResponse = ResponseToSet;
     MockedHttpRequest = RequestToSet;
 }
 /// <summary>
 /// Mock a controller context
 /// </summary>
 public MockControllerContext(
         IController ControllerToSet,
         MockPrincipal PrincipalToSet,
         MockIdentity IdentityToSet,
         MockHttpRequest RequestToSet,
         MockHttpResponse ResponseToSet,
         MockHttpSessionState SessionStateToSet)
     : base(new MockHttpContext(PrincipalToSet, RequestToSet, ResponseToSet, SessionStateToSet), new RouteData(), (ControllerBase)ControllerToSet)
 {
 }