当前位置: 首页>>代码示例>>C#>>正文


C# IClient.Instantiate方法代码示例

本文整理汇总了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;
        }
开发者ID:jwynia,项目名称:stormpath-sdk-dotnet,代码行数:10,代码来源:CustomData_embedded_tests.cs

示例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)
                },
            };
        }
开发者ID:ssankar1234,项目名称:stormpath-sdk-dotnet,代码行数:20,代码来源:TestDataGenerator.cs

示例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")
                },
            };
        }
开发者ID:ssankar1234,项目名称:stormpath-sdk-dotnet,代码行数:13,代码来源:TestDataGenerator.cs

示例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")
                },
            };
        }
开发者ID:ssankar1234,项目名称:stormpath-sdk-dotnet,代码行数:14,代码来源:TestDataGenerator.cs

示例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;
        }
开发者ID:jwynia,项目名称:stormpath-sdk-dotnet,代码行数:14,代码来源:CustomData_tests.cs

示例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}")
         }
     };
 }
开发者ID:ssankar1234,项目名称:stormpath-sdk-dotnet,代码行数:72,代码来源:TestDataGenerator.cs


注:本文中的IClient.Instantiate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。