// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.dnsresolver.generated;

import com.azure.core.management.SubResource;
import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.dnsresolver.fluent.models.DnsForwardingRulesetProperties;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class DnsForwardingRulesetPropertiesTests {
    @Test
    public void testDeserialize() {
        DnsForwardingRulesetProperties model =
            BinaryData
                .fromString(
                    "{\"dnsResolverOutboundEndpoints\":[{\"id\":\"i\"},{\"id\":\"eojnxqbzvddn\"}],\"provisioningState\":\"Creating\",\"resourceGuid\":\"eic\"}")
                .toObject(DnsForwardingRulesetProperties.class);
        Assertions.assertEquals("i", model.dnsResolverOutboundEndpoints().get(0).id());
    }

    @Test
    public void testSerialize() {
        DnsForwardingRulesetProperties model =
            new DnsForwardingRulesetProperties()
                .withDnsResolverOutboundEndpoints(
                    Arrays.asList(new SubResource().withId("i"), new SubResource().withId("eojnxqbzvddn")));
        model = BinaryData.fromObject(model).toObject(DnsForwardingRulesetProperties.class);
        Assertions.assertEquals("i", model.dnsResolverOutboundEndpoints().get(0).id());
    }
}
