Exemplo n.º 1
0
        public async Task TestZoneActivationCheckAsync()
        {
            using var client = new CloudFlareClient(Credentials.Credentials.Authentication);
            var zonesQueryResult = (await client.GetZonesAsync()).Result.First();
            var zoneActivationCheckQueryResult = await client.ZoneActivationCheckAsync(zonesQueryResult.Id);

            Assert.NotNull(zoneActivationCheckQueryResult);

            var notAvailable = new List <int>
            {
                1224, // You may only perform this action once per hour.
            };

            if (!zoneActivationCheckQueryResult.Errors.Any(x => notAvailable.Contains(x.Code)))
            {
                Assert.True(zoneActivationCheckQueryResult.Success);
                if (zoneActivationCheckQueryResult.Errors != null)
                {
                    Assert.Empty(zoneActivationCheckQueryResult.Errors);
                }
            }
        }