Interface IAccountPoolService
Represents the service that provides a pool of users and default properties for them.
Namespace: Relativity.Testing.Framework.Api.Services
Assembly: Relativity.Testing.Framework.Api.dll
Syntax
public interface IAccountPoolService
Examples
private readonly IAccountPoolService _accountPoolService;
...
_accountPoolService = relativityFacade.Resolve<IAccountPoolService>();
Properties
| Improve this Doc View SourceCleanUp
Gets or sets a value indicating whether the pooled accounts will be cleaned up when no longer in the current session.
The default value is false.
Declaration
bool CleanUp { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | By default this is set to |
Examples
_accountPoolService.CleanUp = true;
|
Improve this Doc
View Source
StandardAccountClient
Gets or sets the standard account Client.
Declaration
Client StandardAccountClient { get; set; }
Property Value
| Type | Description |
|---|---|
| Client | A Client to use for the pooled users. |
Examples
_accountPoolService.StandardAccountType = SomeOtherClient;
|
Improve this Doc
View Source
StandardAccountDefaultSelectedFileType
Gets or sets the type of the standard account UserDefaultSelectedFileType.
Declaration
UserDefaultSelectedFileType StandardAccountDefaultSelectedFileType { get; set; }
Property Value
| Type | Description |
|---|---|
| UserDefaultSelectedFileType | A UserDefaultSelectedFileType to use for the pooled users. |
Examples
_accountPoolService.StandardAccountDefaultSelectedFileType = UserDefaultSelectedFileType.Viewer;
|
Improve this Doc
View Source
StandardAccountDocumentViewer
Gets or sets the standard account UserDocumentViewer.
Declaration
UserDocumentViewer StandardAccountDocumentViewer { get; set; }
Property Value
| Type | Description |
|---|---|
| UserDocumentViewer | A UserDocumentViewer to use for the pooled users. |
Examples
_accountPoolService.StandardAccountDocumentViewer = UserDocumentViewer.Default;
|
Improve this Doc
View Source
StandardAccountEmailFormat
Gets or sets the standard account email format.
The default value is "atuser{0}@mail.com".
Declaration
string StandardAccountEmailFormat { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | A string format to use for the email address of pooled users. |
Examples
_accountPoolService.StandardAccountEmailFormat = $"MyCoolRAP_{{0}}_svc@test.com";
|
Improve this Doc
View Source
StandardAccountFirstNameFormat
Gets or sets the standard account first name format.
The default value is "AT {0}".
Declaration
string StandardAccountFirstNameFormat { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | A string format to use for the first name of pooled users. |
Examples
_accountPoolService.StandardAccountFirstNameFormat = $"MyCoolRAP {{0}}";
|
Improve this Doc
View Source
StandardAccountGroupNames
Gets or sets the list of groups that the standard accounts are a part of.
The default groups are [GroupNames.SystemAdministrators](https://relativitydev.github.io/relativity.testing.framework/api/Relativity.Testing.Framework.Models.GroupNames.html#Relativity_Testing_Framework_Models_GroupNames_SystemAdministrators), [GroupNames.DomainUsers](https://relativitydev.github.io/relativity.testing.framework/api/Relativity.Testing.Framework.Models.GroupNames.html#Relativity_Testing_Framework_Models_GroupNames_DomainUsers), and [GroupNames.Everyone](https://relativitydev.github.io/relativity.testing.framework/api/Relativity.Testing.Framework.Models.GroupNames.html#Relativity_Testing_Framework_Models_GroupNames_Everyone).
Declaration
List<string> StandardAccountGroupNames { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> | A list of group names for the pooled users to be added to. |
Examples
Group aeroGroup = _groupService.Require(name, aeroClient);
List<string> groups = { "Everyone", aeroGroup.Name }
_accountPoolService.StandardAccountGroupNames = groups;
|
Improve this Doc
View Source
StandardAccountLastNameFormat
Gets or sets the standard account last name format.
The default value is "User".
Declaration
string StandardAccountLastNameFormat { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | A string format to use for the last name of pooled users. |
Examples
_accountPoolService.StandardAccountLastNameFormat = "ASpecialLastName";
|
Improve this Doc
View Source
StandardAccountPassword
Gets or sets the standard account password.
Declaration
string StandardAccountPassword { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | A string to use as the password of the pooled users. |
Examples
_accountPoolService.StandardAccountPassword = Randomizer.GetString("AT1_!@#");
|
Improve this Doc
View Source
StandardAccountType
Gets or sets the standard account type.
The default value is "Internal".
Declaration
string StandardAccountType { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | A type to use for the pooled users. |
Examples
_accountPoolService.StandardAccountType = "External";
Methods
| Improve this Doc View SourceAcquireStandardAccount()
Acquires a user from the account pool.
Will create a user if there are none left in the account pool.
Users are created based on the StandardAccount properties that have been set.
Declaration
AccountBaseInfo AcquireStandardAccount()
Returns
| Type | Description |
|---|---|
| AccountBaseInfo | The AccountBaseInfo. |
Examples
AccountBaseInfo user1 = _accountPoolService.AcquireStandardAccount();
AccountBaseInfo user2 = _accountPoolService.AcquireStandardAccount();
|
Improve this Doc
View Source
DeleteAndAcquireStandardAccount()
Acquires a user from the account pool, but will forcibly delete and recreate it first.
Will create a user if there are none left in the account pool.
This should be used over AcquireStandardAccount() when the account might already exist, and you do not know what the password for it is.
Declaration
AccountBaseInfo DeleteAndAcquireStandardAccount()
Returns
| Type | Description |
|---|---|
| AccountBaseInfo | The AccountBaseInfo. |
Examples
AccountBaseInfo user1 = _accountPoolService.DeleteAndAcquireStandardAccount();
AccountBaseInfo user2 = _accountPoolService.DeleteAndAcquireStandardAccount();
|
Improve this Doc
View Source
GetStandardAccount(String)
Gets a user from the account pool.
Declaration
AccountBaseInfo GetStandardAccount(string email)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | The user email. |
Returns
| Type | Description |
|---|---|
| AccountBaseInfo | The AccountBaseInfo or |
Examples
_accountPoolService.PrepareStandardAccounts(1);
AccountBaseInfo user1 = _accountPoolService.GetStandardAccount(); // Returns a user.
AccountBaseInfo user2 = _accountPoolService.GetStandardAccount(); // Returns null.
|
Improve this Doc
View Source
IsStandardAccount(String)
Determines whether there is a standard account with the specified email.
Declaration
bool IsStandardAccount(string email)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | The user email. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Examples
_accountPoolService.StandardAccountEmailFormat = $"MyCoolRAP_{{0}}_svc@test.com";
_accountPoolService.PrepareStandardAccounts(1);
_accountPoolService.IsStandardAccount("MyCoolRAP_1_svc@test.com"); // Returns true.
_accountPoolService.IsStandardAccount("MyCoolRAP_2_svc@test.com"); // Returns false.
|
Improve this Doc
View Source
PrepareStandardAccounts(Int32)
Prepares (creates if there are no existing) the specified count of standard accounts.
Users are created based on the StandardAccount properties that have been set.
Declaration
void PrepareStandardAccounts(int count)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | count | The count of accounts. |
Examples
_accountPoolService.PrepareStandardAccounts(2);
|
Improve this Doc
View Source
ReleaseAccount(String)
Releases the account, allowing it to be acquired at a later time.
Declaration
void ReleaseAccount(string email)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | The user email. |
Examples
_accountPoolService.StandardAccountEmailFormat = $"MyCoolRAP_{{0}}_svc@test.com";
AccountBaseInfo user1 = _accountPoolService.AcquireStandardAccount(); // Creates and returns "MyCoolRAP_1_svc@test.com"
AccountBaseInfo user2 = _accountPoolService.AcquireStandardAccount(); // Creates and returns "MyCoolRAP_2_svc@test.com"
_accountPoolService.ReleaseAccount("MyCoolRAP_1_svc@test.com");
user1 = _accountPoolService.AcquireStandardAccount(); // Returns the already created and previously released "MyCoolRAP_1_svc@test.com"