예제 #1
0
        public void Reset_RedirectsToRecoverIfCanNotReset()
        {
            service.IsLoggedIn().Returns(false);
            validator.CanReset(Arg.Any <AccountResetView>()).Returns(false);

            Object actual   = (controller.Reset("Token") as RedirectToRouteResult).RouteValues["action"];
            Object expected = "Recover";

            Assert.AreSame(expected, actual);
        }
예제 #2
0
        public void Reset_CanNotReset_RedirectsToRecover()
        {
            service.IsLoggedIn(controller.User).Returns(false);
            validator.CanReset(Arg.Any <AccountResetView>()).Returns(false);

            Object expected = RedirectToAction(controller, nameof(Auth.Recover));
            Object actual   = controller.Reset("Token");

            Assert.Same(expected, actual);
        }
        public void Reset_RedirectsToRecoverIfCanNotReset()
        {
            service.IsLoggedIn(controller.User).Returns(false);
            validator.CanReset(Arg.Any <AccountResetView>()).Returns(false);

            RouteValueDictionary actual = (controller.Reset("Token") as RedirectToRouteResult).RouteValues;

            Assert.Equal("Recover", actual["action"]);
            Assert.Equal(1, actual.Count);
        }