Пример #1
0
        public static void TestUpdateMembershipStatusAsync(SetMembershipStatus status)
        {
            using var client = new CloudFlareClient(Credentials.Credentials.Authentication);
            var userMembership = client.GetMembershipsAsync().Result;

            if (userMembership.Result.First().Status == MembershipStatus.Accepted)
            {
                var updateUserMembershipStatus = client.UpdateMembershipStatusAsync(userMembership.Result.First().Id, status).Result;

                Assert.NotNull(updateUserMembershipStatus);
                Assert.Contains(1001, updateUserMembershipStatus.Errors.Select(x => x.Code));
                Assert.False(updateUserMembershipStatus.Success);
            }
        }