public void Logout_LogsOutCurrentUser() { _controller = new LoginController(_apiClient.Object, _session); var result = _controller.Logout(); Assert.That(_session.Authenticated, Is.False); Assert.That(_session.EmailAddress, Is.EqualTo(string.Empty)); Assert.That(_session.JustGivingPassword, Is.EqualTo(string.Empty)); Assert.That(_session.Pages, Is.Null); }
public void Logout_CallsLogout_Redirects() { var session = new Mock<ICurrentUserSession>(); _controller = new LoginController(_apiClient.Object, session.Object); var result = _controller.Logout(); session.Verify(x => x.Logout()); Assert.That(result, Is.TypeOf<RedirectToRouteResult>()); }