Ejemplo n.º 1
0
 private void PrepareController()
 {
     this.controller.Request = this.HttpRequestMessage;
     this.controller.Request.TransformToAbsoluteRequestUri();
     this.controller.RequestContext = this.HttpRequestMessage.GetRequestContext();
     this.controller.Configuration  = this.GetHttpConfiguration();
     this.controller.Request.SetConfiguration(this.controller.Configuration);
     this.controller.User = MockedIPrincipal.CreateUnauthenticated();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Sets default authenticated user to the built controller with "TestUser" username.
 /// </summary>
 /// <returns>The same controller builder.</returns>
 public IAndControllerBuilder <TController> WithAuthenticatedUser()
 {
     this.Controller.User = MockedIPrincipal.CreateDefaultAuthenticated();
     return(this);
 }