Beispiel #1
0
        public void TestCustodian()
        {
            var community = _communitiesCommand.CreateTestCommunity(0);
            var custodian = _custodianAccountsCommand.CreateTestCustodian(0, community.Id);

            TestLogout(custodian, LoggedInCustodianHomeUrl, HomeUrl);
        }
        public override TemplateEmail GeneratePreview(Community community)
        {
            if (community == null)
            {
                community = TestCommunity.MonashGsb.CreateTestCommunity(_communitiesCommand, _verticalsCommand, _contentEngine);
            }
            var custodian = _custodianAccountsCommand.CreateTestCustodian(LoginId, community.Id);
            var enquiry   = CreateEnquiry();

            return(new AdministratorEmployerEnquiryEmail(community, new[] { custodian }, enquiry));
        }
Beispiel #3
0
        private void LogIn()
        {
            var community     = TestCommunity.Scouts.CreateTestCommunity(_communitiesCommand, _verticalsCommand, _contentEngine);
            var administrator = _custodianAccountsCommand.CreateTestCustodian(0, community.Id);

            LogIn(administrator);
        }
Beispiel #4
0
        public void TestPageVisibility()
        {
            // Create the custodian.

            var administrator = _administratorAccountsCommand.CreateTestAdministrator(1);

            var community = CreateCommunity();
            var custodian = _custodianAccountsCommand.CreateTestCustodian(2, community.Id);

            LogIn(administrator);
            Get(GetCustodianUrl(custodian));

            // Assert that everything is as it should be.

            AssertVisibility(custodian);
            AssertCustodian(custodian);
        }
Beispiel #5
0
        public void TestCustodian()
        {
            var custodian0 = _custodianAccountsCommand.CreateTestCustodian(0, Guid.NewGuid());
            var custodian1 = _custodianAccountsCommand.CreateTestCustodian(1, Guid.NewGuid());

            AssertLogIns(0, 0, 0, 0);

            LogIn(custodian0);
            LogOut();
            AssertLogIns(0, 0, 0, 1);

            LogIn(custodian0);
            LogOut();
            AssertLogIns(0, 0, 0, 1);

            LogIn(custodian1);
            LogOut();
            AssertLogIns(0, 0, 0, 2);
        }
Beispiel #6
0
        public void TestCustodian()
        {
            // Create the custodian.

            var community = _communitiesCommand.CreateTestCommunity(0);
            var custodian = _custodianAccountsCommand.CreateTestCustodian(0, community.Id);

            // Log in.

            AssertNotLoggedIn();
            AssertJsonSuccess(ApiLogIn(custodian));

            // Assert that the user was directed to the administrator home page after login.

            Get(HomeUrl);
            AssertUrl(LoggedInCustodianHomeUrl);
            AssertPageContains(custodian.FullName);
        }
Beispiel #7
0
        public void TestCustodian()
        {
            // Create the custodian.

            var community = _communitiesCommand.CreateTestCommunity(0);
            var custodian = _custodianAccountsCommand.CreateTestCustodian(0, community.Id);

            // Assert that the user is not already logged in.

            GetLoginUrl();
            AssertPageDoesNotContain(custodian.FullName);

            // Log in.

            SubmitLogIn(custodian);

            // Assert that the user was directed to the administrator home page after login.

            AssertUrl(LoggedInCustodianHomeUrl);
            AssertPageContains(custodian.FullName);
        }
Beispiel #8
0
        public void TestCommunityCustodianLinks()
        {
            var employer = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));

            PostJobAds(employer);

            // Create a community administrator and login.

            var custodian = _custodianAccountsCommand.CreateTestCustodian(0, Guid.NewGuid());

            LogIn(custodian);

            // Assert the root page.

            var rootUrl = new ReadOnlyApplicationUrl(true, "/");
            var url     = new ReadOnlyApplicationUrl(true, "~/custodians/home").AbsoluteUri;
            var cookies = new CookieContainer();

            cookies.Add(Browser.Cookies.GetCookies(new Uri(url)));

            AssertUrl(url, null, true, false, cookies, rootUrl);
        }
Beispiel #9
0
        public void TestCustodian()
        {
            // Create the custodian.

            var community = _communitiesCommand.CreateTestCommunity(0);
            var custodian = _custodianAccountsCommand.CreateTestCustodian(0, community.Id);

            // Log in.

            Get(HomeUrl);
            SubmitLogIn(custodian);
            var login = AssertActivity(_userSessionsQuery.GetUserActivity(custodian.Id), AuthenticationStatus.Authenticated);

            // Logout.

            TestUtils.SleepForDifferentSqlTimestamp();
            LogOut();

            var logout = new UserLogout {
                UserId = custodian.Id
            };

            AssertActivities(_userSessionsQuery.GetUserActivity(custodian.Id), GetExpectedActivities(login, logout));
        }
        public void TestCreateAccount()
        {
            var custodian = _custodianAccountsCommand.CreateTestCustodian(0, Guid.NewGuid());

            AssertAreEqual(custodian, _custodiansQuery.GetCustodian(custodian.Id));
        }
Beispiel #11
0
        public void TestCustodian()
        {
            var custodian = _custodianAccountsCommand.CreateTestCustodian(0, Guid.NewGuid());

            AssertJsonError(LogIn(HttpStatusCode.Forbidden, custodian.GetLoginId(), custodian.GetPassword()), null, "101", "Login failed. Please try again.");
        }
Beispiel #12
0
 protected Custodian CreateCustodian(int index, Community community)
 {
     return(_custodianAccountsCommand.CreateTestCustodian(index, community.Id));
 }
        protected override RegisteredUser CreateUser()
        {
            var community = _communitiesCommand.CreateTestCommunity(0);

            return(_custodianAccountsCommand.CreateTestCustodian(0, community.Id));
        }
Beispiel #14
0
 private Custodian CreateCustodian(int index)
 {
     return(_custodianAccountsCommand.CreateTestCustodian(index, Guid.NewGuid()));
 }
Beispiel #15
0
 public static Custodian CreateTestCustodian(this ICustodianAccountsCommand custodianAccountsCommand, int index, Guid affiliateId)
 {
     return(custodianAccountsCommand.CreateTestCustodian(string.Format(UserIdFormat, index), string.Format(FirstNameFormat, index), string.Format(LastNameFormat, index), affiliateId));
 }
Beispiel #16
0
 public static Custodian CreateTestCustodian(this ICustodianAccountsCommand custodianAccountsCommand, string loginId, Guid affiliateId)
 {
     return(custodianAccountsCommand.CreateTestCustodian(loginId, string.Format(FirstNameFormat, 0), string.Format(LastNameFormat, 0), affiliateId));
 }
Beispiel #17
0
        private Custodian CreateCustodian()
        {
            var community = _communitiesCommand.CreateTestCommunity(1);

            return(_custodianAccountsCommand.CreateTestCustodian(0, community.Id));
        }