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(); }
/// <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); }