How to unit test code that uses FederatedAuthentication.SessionAuthenticationModule
问题 How can I test this code (Login method in a ASP.NET MVC 4, .NET 4.5 web app): public ActionResult Login(LoginModel model, string returnUrl) { if (ModelState.IsValid && _userCredentialsService.ValidateUser(model.UserName, model.Password)) { SessionAuthentication.SetAuthCookie(model.UserName, _userCredentialsService.GetUserGroups(model.UserName), model.RememberMe); return RedirectToLocal(returnUrl); } } that uses this SetAuthCookie method: public static void SetAuthCookie(IEnumerable<Claim>