Ich habe die Überschreibung unten, um ein paar Dinge mit Cookies mit dem FormsIdentity-Objekt zu tun. Aber wenn ich einen Controller auf meinem Unit Testing instanziieren diese Methode nicht ausgelöst wird. Irgendwelche Ideen, wie dies zu tun?
protected override void Initialize(System.Web.Routing.RequestContext requestContext)
{
base.Initialize(requestContext);
// Grab the user's login information from FormsAuth
_userState = new UserState();
if (this.User.Identity != null && this.User.Identity is FormsIdentity)
this._userState.FromString(((FormsIdentity)this.User.Identity).Ticket.UserData);
// have to explicitly add this so Master can see untyped value
this.UserState = _userState;
//this.ViewData["ErrorDisplay"] = this.ErrorDisplay;
// custom views should also add these as properties
}