示例#1
0
 public MaintainAdministratorsController(IUserAccountsCommand userAccountsCommand, ILoginCredentialsCommand loginCredentialsCommand, ILoginCredentialsQuery loginCredentialsQuery, IAdministratorAccountsCommand administratorAccountsCommand, IAdministratorsQuery administratorsQuery)
 {
     _userAccountsCommand          = userAccountsCommand;
     _loginCredentialsCommand      = loginCredentialsCommand;
     _loginCredentialsQuery        = loginCredentialsQuery;
     _administratorAccountsCommand = administratorAccountsCommand;
     _administratorsQuery          = administratorsQuery;
 }
示例#2
0
        public static Administrator CreateTestAdministrator(this IAdministratorAccountsCommand administratorAccountsCommand, string loginId, string firstName, string lastName)
        {
            var administrator = new Administrator
            {
                EmailAddress = new EmailAddress {
                    Address = string.Format(EmailAddressFormat, loginId)
                },
                FirstName = firstName,
                LastName  = lastName,
            };

            administratorAccountsCommand.CreateAdministrator(administrator, new LoginCredentials {
                LoginId = loginId, PasswordHash = LoginCredentials.HashToString(DefaultPassword)
            });
            return(administrator);
        }
示例#3
0
 public static Administrator CreateTestAdministrator(this IAdministratorAccountsCommand administratorAccountsCommand, string loginId)
 {
     return(administratorAccountsCommand.CreateTestAdministrator(loginId, string.Format(FirstNameFormat, 0), string.Format(LastNameFormat, 0)));
 }
示例#4
0
 public static Administrator CreateTestAdministrator(this IAdministratorAccountsCommand administratorAccountsCommand, int index)
 {
     return(administratorAccountsCommand.CreateTestAdministrator(string.Format(UserIdFormat, index), string.Format(FirstNameFormat, index), string.Format(LastNameFormat, index)));
 }