public void TestJsonRegister()
        {
            string testUserName = "******";
            string testPassword = "******";
            string testConfirmPassword = "******";
            string testEmail = "*****@*****.**";

            var registerModel = new RegisterModel
            {
                UserName = testUserName,
                Password = testPassword,
                ConfirmPassword = testConfirmPassword,
                Email = testEmail
            };

            var accountController = new AccountController();
            JsonResult jsonResult;
            //Scope the detours we're creating
            using (ShimsContext.Create())
            {
                //Sets up a detour for Membership.CreateUser to our mocked implementation
                ShimMembership.CreateUserStringStringStringStringStringBooleanObjectMembershipCreateStatusOut =
                    (string userName, string password, string email, string passwordQuestion,
                        string passwordAnswer, bool isApproved, object providerUserKey,
                        out MembershipCreateStatus @createStatus) =>
                    {
                        Assert.AreEqual(testUserName, userName);
                        Assert.AreEqual(testPassword, password);
                        Assert.AreEqual(testEmail, email);
                        Assert.Null(passwordQuestion);
                        Assert.Null(passwordAnswer);
                        Assert.True(isApproved);
                        Assert.Null(providerUserKey);
                        @createStatus = MembershipCreateStatus.Success;

                        return null;
                    };

                //Sets up a detour for FormsAuthentication.SetAuthCookie to our mocked implementation
                ShimFormsAuthentication.SetAuthCookieStringBoolean = (userName, rememberMe) =>
                {
                    Assert.AreEqual(testUserName, userName);
                    Assert.AreEqual(false, rememberMe);
                };

                var actionResult = accountController.JsonRegister(registerModel);
                Assert.IsInstanceOf(typeof(JsonResult), actionResult);
                jsonResult = actionResult as JsonResult;
            }

            Assert.NotNull(jsonResult);
            var success = (bool)(new PrivateObject(jsonResult.Data, "success")).Target;
            Assert.True(success);
        }