Пример #1
0
 public MemberAccountsCommand(IMembersCommand membersCommand, IMembersQuery membersQuery, ILoginCredentialsCommand loginCredentialsCommand, ILoginCredentialsQuery loginCredentialsQuery, IExternalCredentialsCommand externalCredentialsCommand, ICandidatesCommand candidatesCommand, IMemberAffiliationsCommand memberAffiliationsCommand)
 {
     _membersCommand             = membersCommand;
     _membersQuery               = membersQuery;
     _loginCredentialsCommand    = loginCredentialsCommand;
     _loginCredentialsQuery      = loginCredentialsQuery;
     _externalCredentialsCommand = externalCredentialsCommand;
     _candidatesCommand          = candidatesCommand;
     _memberAffiliationsCommand  = memberAffiliationsCommand;
 }
Пример #2
0
        public static Member CreateTestMember(this IMembersCommand membersCommand, string emailAddress, string firstName, string lastName, DateTime?createdTime)
        {
            var member = new Member
            {
                IsEnabled      = true,
                IsActivated    = true,
                EmailAddresses = new List <EmailAddress> {
                    new EmailAddress {
                        Address = emailAddress, IsVerified = true
                    }
                },
                PhoneNumbers = new List <PhoneNumber> {
                    new PhoneNumber {
                        Number = DefaultPhoneNumber, Type = PhoneNumberType.Mobile
                    }
                },
                FirstName          = firstName,
                LastName           = lastName,
                Gender             = DefaultGender,
                DateOfBirth        = DefaultDateOfBirth,
                VisibilitySettings = new VisibilitySettings(),
            };

            if (createdTime.HasValue)
            {
                member.CreatedTime     = createdTime.Value;
                member.LastUpdatedTime = createdTime.Value;
            }

            // Deny public access to real name, because existing tests rely on this. Might need to change this later.

            member.VisibilitySettings.Personal.PublicVisibility &= ~PersonalVisibility.Name;

            member.Address = new Address {
                Location = new LocationReference()
            };
            _locationQuery.ResolvePostalSuburb(member.Address.Location, DefaultCountry, DefaultLocation);

            membersCommand.CreateMember(member);
            return(member);
        }
Пример #3
0
 public static Member CreateTestMember(this IMembersCommand membersCommand, string emailAddress, string firstName, string lastName)
 {
     return(membersCommand.CreateTestMember(emailAddress, firstName, lastName, null));
 }
Пример #4
0
 public static Member CreateTestMember(this IMembersCommand membersCommand, string emailAddress)
 {
     return(membersCommand.CreateTestMember(emailAddress, string.Format(FirstNameFormat, 0), string.Format(LastNameFormat, 0)));
 }
Пример #5
0
 public static Member CreateTestMember(this IMembersCommand membersCommand, int index, DateTime createTime)
 {
     return(membersCommand.CreateTestMember(string.Format(EmailAddressFormat, index), string.Format(FirstNameFormat, index), string.Format(LastNameFormat, index), createTime));
 }