public void LogoutShouldRedirectUserToHomePage(Database db, [Content] DbItem item, IAccountRepository repo, INotificationService ns) { var fakeSite = new FakeSiteContext(new StringDictionary { { "rootPath", "/sitecore/content" }, { "startItem", item.Name } }) as SiteContext; fakeSite.Database = db; Language.Current = Language.Invariant; using (new SiteContextSwitcher(fakeSite)) { var ctrl = new AccountsController(repo, ns); var result = ctrl.Logout(); result.Should().BeOfType<RedirectResult>().Which.Url.Should().Be("/"); } }
public void LogoutShouldCallSitecoreLogout(Database db, [Content] DbItem item, IAccountRepository repo, INotificationService ns) { var fakeSite = new FakeSiteContext(new StringDictionary { { "rootPath", "/sitecore/content" }, { "startItem", item.Name } }) as SiteContext; fakeSite.Database = db; using (new SiteContextSwitcher(fakeSite)) { var ctrl = new AccountsController(repo, ns); ctrl.Logout(); repo.Received(1).Logout(); } }