本文整理汇总了C#中IClient.Instantiate方法的典型用法代码示例。如果您正苦于以下问题:C# IClient.Instantiate方法的具体用法?C# IClient.Instantiate怎么用?C# IClient.Instantiate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IClient
的用法示例。
在下文中一共展示了IClient.Instantiate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateRandomAccountInstance
private IAccount CreateRandomAccountInstance(IClient client)
{
var accountObject = client.Instantiate<IAccount>();
accountObject.SetEmail(new RandomEmail("testing.foo"));
accountObject.SetGivenName("Test");
accountObject.SetSurname("Testerman");
accountObject.SetPassword(new RandomPassword(12));
return accountObject;
}
示例2: GetTestApplications
public List<IApplication> GetTestApplications(IClient client)
{
var timeString = DateTimeOffset.UtcNow.ToString("s", System.Globalization.CultureInfo.InvariantCulture);
return new List<IApplication>()
{
{
client.Instantiate<IApplication>()
.SetName($".NET IT (disabled) {this.Nonce} - {timeString}")
.SetDescription("The Battle of Yavin")
.SetStatus(ApplicationStatus.Disabled)
},
{
client.Instantiate<IApplication>()
.SetName($".NET IT (primary) {this.Nonce} - {timeString}")
.SetDescription("The Battle of Endor")
.SetStatus(ApplicationStatus.Enabled)
},
};
}
示例3: GetTestGroups
public List<IGroup> GetTestGroups(IClient client)
{
var timeString = DateTimeOffset.UtcNow.ToString("s", System.Globalization.CultureInfo.InvariantCulture);
return new List<IGroup>()
{
{
client.Instantiate<IGroup>()
.SetName($".NET IT Test Group (primary) {this.Nonce} - {timeString}")
.SetDescription("Humans")
},
};
}
示例4: GetTestOrganizations
public List<IOrganization> GetTestOrganizations(IClient client)
{
var timeString = DateTimeOffset.UtcNow.ToString("s", System.Globalization.CultureInfo.InvariantCulture);
return new List<IOrganization>()
{
{
client.Instantiate<IOrganization>()
.SetName($".NET IT Test Organization (primary) {this.Nonce} - {timeString}")
.SetNameKey($"dotnet-it-test-org-{this.Nonce}")
.SetDescription("Star Wars")
},
};
}
示例5: CreateRandomAccountAsync
private async Task<IAccount> CreateRandomAccountAsync(IClient client)
{
var accountObject = client.Instantiate<IAccount>();
accountObject.SetEmail(new RandomEmail("testing.foo"));
accountObject.SetGivenName("Test");
accountObject.SetSurname("Testerman");
accountObject.SetPassword(new RandomPassword(12));
var app = await client.GetResourceAsync<IApplication>(this.fixture.PrimaryApplicationHref);
var created = await app.CreateAccountAsync(accountObject, x => x.RegistrationWorkflowEnabled = false);
this.fixture.CreatedAccountHrefs.Add(created.Href);
return created;
}
示例6: GetTestAccounts
public List<IAccount> GetTestAccounts(IClient client)
{
return new List<IAccount>()
{
{
client.Instantiate<IAccount>()
.SetGivenName("Luke")
.SetSurname("Skywalker")
.SetEmail("[email protected]")
.SetPassword("whataPieceofjunk$1138")
.SetUsername($"sonofthesuns-{this.Nonce}")
},
{
client.Instantiate<IAccount>()
.SetGivenName("Han")
.SetSurname("Solo")
.SetEmail("[email protected]")
.SetPassword(new RandomPassword(12))
.SetUsername($"cptsolo-{this.Nonce}")
},
{
client.Instantiate<IAccount>()
.SetGivenName("Leia")
.SetSurname("Organa")
.SetEmail("[email protected]")
.SetPassword(new RandomPassword(12))
.SetUsername($"princessleia-{this.Nonce}")
},
{
client.Instantiate<IAccount>()
.SetGivenName("Chewbacca")
.SetMiddleName("the")
.SetSurname("Wookiee")
.SetEmail("[email protected]")
.SetPassword(new RandomPassword(12))
.SetUsername($"rrwwwggg-{this.Nonce}")
},
{
client.Instantiate<IAccount>()
.SetGivenName("Lando")
.SetSurname("Calrissian")
.SetEmail("[email protected]")
.SetPassword(new RandomPassword(12))
.SetUsername($"lottanerve-{this.Nonce}")
},
{
client.Instantiate<IAccount>()
.SetGivenName("Darth")
.SetSurname("Vader")
.SetEmail("[email protected]")
.SetPassword(new RandomPassword(12))
.SetUsername($"lordvader-{this.Nonce}")
},
{
client.Instantiate<IAccount>()
.SetGivenName("Emperor")
.SetSurname("Palpatine")
.SetEmail("[email protected]")
.SetPassword(new RandomPassword(12))
.SetUsername($"rulethegalaxy-{this.Nonce}")
},
{
client.Instantiate<IAccount>()
.SetGivenName("Wilhuff")
.SetSurname("Tarkin")
.SetEmail("[email protected]")
.SetStatus(AccountStatus.Disabled)
.SetPassword(new RandomPassword(12))
.SetUsername($"tarkin-{this.Nonce}")
}
};
}