public void TestSerialization() { var sut = new CustomHostname(); JsonHelper.GetSerializedKeys(sut).Should().BeEquivalentTo(new SortedSet <string> { "id", "hostname", "ssl", "status", "custom_origin_server", "verification_errors", "ownership_verification", "ownership_verification_http", "created_at", "custom_metadata" }); }
public async Task TestDeleteCustomHostnameAsync() { var zone = ZoneTestData.Zones.First(); var customHostname = CustomHostnameTestData.CustomHostnames.First(); var expected = new CustomHostname { Id = customHostname.Id }; _wireMockServer .Given(Request.Create().WithPath($"/{ZoneEndpoints.Base}/{zone.Id}/{CustomHostnameEndpoints.Base}/{customHostname.Id}").UsingDelete()) .RespondWith(Response.Create().WithStatusCode(200) .WithBody(WireMockResponseHelper.CreateTestResponse(expected))); using var client = new CloudFlareClient(WireMockConnection.ApiKeyAuthentication, _connectionInfo); var deleteCustomHostname = await client.Zones.CustomHostnames.DeleteAsync(zone.Id, customHostname.Id); deleteCustomHostname.Result.Should().BeEquivalentTo(expected); }