Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WebSecurity.Login(model.Username, model.Password, model.RememberMe)
- public ActionResult Login(LoginModel model, string returnUrl)
- {
- if (ModelState.IsValid && !string.IsNullOrEmpty(model.Username) && !string.IsNullOrEmpty(model.Password))
- {
- if (WebSecurity.UserExists(model.Username))
- {
- if (WebSecurity.IsConfirmed(model.Username))
- {
- if (WebSecurity.Login(model.Username, model.Password, model.RememberMe)) // **Exception is thrown at this line**
- {
- return RedirectUser(model);
- }
- }
- }
- }
- }
- [TestMethod]
- public void T01_Case106()
- {
- var ac_controller = DependencyResolver.Current.GetService<AccountController>();
- var login_response = ac_controller.Login(_testStudio.LoginModel, string.Empty);
- Assert.IsNotNull(login_response);
- }
- public class TestStudio
- {
- public LoginModel LoginModel = new LoginModel { Username = "admin@gr.com", Password = "1234567"
- };
- System.NullReferenceException: Object reference not set to an instance of an object.
- at System.Web.Security.FormsAuthentication.SetAuthCookie(String userName, Boolean createPersistentCookie, String strCookiePath)
- at System.Web.Security.FormsAuthentication.SetAuthCookie(String userName, Boolean createPersistentCookie)
- at WebMatrix.WebData.WebSecurity.Login(String userName, String password, Boolean persistCookie)
- at Groove.Controllers.Web.AccountController.Login(LoginModel model, String returnUrl) in D:projectGrooveWebGrooveControllersWebAccountController.cs:line 89
Add Comment
Please, Sign In to add comment