public void EditReturnsModelIfUserExists()
 {
     var controller = new AdministrativeToolController();
     var roles = new List<string> { "Admin" }.ToArray();
     using (MolesContext.Create())
     {
         var user = new MMembershipUser
         {
             UserNameGet = () => testUserName,
             EmailGet = () => testEmail,
             IsApprovedGet = () => true,
             LastActivityDateGet = () => DateTime.Now,
             IsOnlineGet = () => true,
         };
         MRoles.GetAllRoles = () => roles;
         MRoles.GetRolesForUserString = (userName) => roles;
         MMembership.GetUserString = (userName) =>
         {
             Assert.AreEqual(testUserName, userName);
             return user;
         };
         var result = (ViewResult)controller.Edit(testUserName);
         Assert.AreNotEqual("Error", result.ViewName);
     }
 }
 public void PasswordResetReturnsErrorIfUserDoesNotExist()
 {
     var controller = new AdministrativeToolController();
     using (MolesContext.Create())
     {
         MAccountService.PasswordResetString = (userName) => "Error";
         var jsonResult = (JsonResult)controller.PasswordReset(testUserName);
         Assert.AreEqual("{ message = Error }", jsonResult.Data.ToString());
     }
 }
 public void EditReturnsErrorIfUserDoesNotExist()
 {
     var controller = new AdministrativeToolController();
     using (MolesContext.Create())
     {
         MMembership.GetUserString = (userName) => null;
         var result = (ViewResult)controller.Edit(testUserName);
         Assert.AreEqual("Error", result.ViewName);
     }
 }