Ejemplo n.º 1
0
        public static void TestGetRolesAsync()
        {
            using var client = new CloudFlareClient(Credentials.Credentials.Authentication);
            var accounts      = client.GetAccountsAsync().Result;
            var subscriptions = client.GetAccountSubscriptionsAsync(accounts.Result.First().Id).Result;

            Assert.NotNull(subscriptions);
            Assert.True(subscriptions.Success);
            if (subscriptions.Errors != null)
            {
                Assert.Empty(subscriptions.Errors);
            }
        }
        public MinimumPlanEnterpriseTheoryAttribute()
        {
            var hasEnterpriseLevelAccount = false;

            using (var client = new CloudFlareClient(Credentials.Credentials.Authentication))
            {
                var accounts = client.GetAccountsAsync().Result.Result;
                foreach (var account in accounts)
                {
                    var subscriptions = client.GetAccountSubscriptionsAsync(account.Id).Result.Result;
                    if (subscriptions.Any(subscription => subscription.RatePlan.Id == LegacyType.Enterprise))
                    {
                        hasEnterpriseLevelAccount = true;
                    }
                }
            }

            if (!hasEnterpriseLevelAccount)
            {
                Skip = "Minimum enterprise level account needed!";
            }
        }