public void TestSerialization() { var sut = new DeletedSubscription(); JsonHelper.GetSerializedKeys(sut).Should().BeEquivalentTo(new SortedSet <string> { "subscription_id" }); }
public async Task TestDeleteAccountSubscriptionsAsync() { var accountId = AccountTestData.Accounts.First().Id; var subscription = SubscriptionTestData.Subscriptions.First(); var expected = new DeletedSubscription { SubscriptionId = subscription.Id }; _wireMockServer .Given(Request.Create().WithPath($"/{AccountEndpoints.Base}/{accountId}/{AccountEndpoints.Subscriptions}/{subscription.Id}").UsingDelete()) .RespondWith(Response.Create().WithStatusCode(200) .WithBody(WireMockResponseHelper.CreateTestResponse(expected))); using var client = new CloudFlareClient(WireMockConnection.ApiKeyAuthentication, _connectionInfo); var deletedSubscription = await client.Accounts.Subscriptions.DeleteAsync(accountId, subscription.Id); deletedSubscription.Result.Should().BeEquivalentTo(expected); }