FormsAuthentication.SetAuthCookie mocking using Moq
Hi i'm doing some unit test on my ASP.Net MVC2 project. I'm using Moq framework. In my LogOnController, [HttpPost] public ActionResult LogOn(LogOnModel model, string returnUrl = "") { FormsAuthenticationService FormsService = new FormsAuthenticationService(); FormsService.SignIn(model.UserName, model.RememberMe); } In FormAuthenticationService class, public class FormsAuthenticationService : IFormsAuthenticationService { public virtual void SignIn(string userName, bool createPersistentCookie) { if (String.IsNullOrEmpty(userName)) throw new ArgumentException("Value cannot be null or empty.",