public void AccountControllerLogoff() { const bool ISAJAX = true; var factory = new WorkChannelFactoryMock(); var auth = new FakeAuthenticationService(); var ctrl = new AccountController(factory, auth); FakeControllerSession.SetFakeControllerContext(ctrl, ISAJAX); var res2 = ctrl.LogOff() as RedirectToRouteResult; Assert.IsNotNull(res2); Assert.AreEqual(res2.RouteValues["action"], "Index"); }