예제 #1
0
        public void AccountControllerRegister()
        {
            const bool ISAJAX = true;
            var info = new RegisterViewModel()
            {
                UserName = "******",
                Password = "******",
                ConfirmPassword = "******",
                Address = "asd"
            };

            var factory = new WorkChannelFactoryMock();
            var auth = new FakeAuthenticationService();
            var ctrl = new AccountController(factory, auth);
            FakeControllerSession.SetFakeControllerContext(ctrl, ISAJAX);

            var res2 = ctrl.Register(info) as RedirectToRouteResult;
            Assert.IsNotNull(res2);
            Assert.AreEqual(res2.RouteValues["action"], "Index");
            Assert.AreEqual(factory.LastWorkChannel.UsersRegistered.Count, 1);
            Assert.AreEqual(factory.LastWorkChannel.UsersRegistered[0].Email, "Admin");
        }