public void SetUp() { _currentUserSession = new CurrentUserSession(); _context = new ActionExecutingContext(); _attribute = new AuthenticatedUserOnlyAttribute(); AuthenticatedUserOnlyAttribute.GetCurrentUserSession = () => _currentUserSession; }
public void Login_SetsValues() { var cu = new CurrentUserSession(); cu.Login("*****@*****.**", "password"); Assert.That(cu.Authenticated, Is.True); Assert.That(cu.EmailAddress, Is.EqualTo("*****@*****.**")); Assert.That(cu.JustGivingPassword, Is.EqualTo("password")); Assert.That(cu.Pages, Is.Not.Null); }
public void Logout_ClearsSessionValues() { var cu = new CurrentUserSession { Authenticated = true, EmailAddress = "*****@*****.**", JustGivingPassword = "******", OrganisationName = "Orgname", Pages = new FundraisingPageSummaries() }; cu.Logout(); Assert.That(cu.Authenticated, Is.False); Assert.That(cu.EmailAddress, Is.EqualTo(string.Empty)); Assert.That(cu.JustGivingPassword, Is.EqualTo(string.Empty)); Assert.That(cu.OrganisationName, Is.EqualTo(string.Empty)); Assert.That(cu.Pages, Is.Null); }
public virtual void SetUp() { _apiClient = new Mock<IApiClient>(); _userImageService = new Mock<IUserImagesService>(); _currentUserSession = new CurrentUserSession(); _controller = new CreateController(_apiClient.Object, _userImageService.Object, _currentUserSession); }
public virtual void SetUp() { _apiClient = new Mock<IApiClient>(); _session = new CurrentUserSession(); _controller = new LoginController(_apiClient.Object, _session); }