// 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.VirtualNetworkDnsForwardingRulesetInner;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class VirtualNetworkDnsForwardingRulesetInnerTests {
    @Test
    public void testDeserialize() {
        VirtualNetworkDnsForwardingRulesetInner model =
            BinaryData
                .fromString("{\"id\":\"fsnkymuctq\",\"properties\":{\"virtualNetworkLink\":{\"id\":\"ebrjcxe\"}}}")
                .toObject(VirtualNetworkDnsForwardingRulesetInner.class);
        Assertions.assertEquals("fsnkymuctq", model.id());
        Assertions.assertEquals("ebrjcxe", model.virtualNetworkLink().id());
    }

    @Test
    public void testSerialize() {
        VirtualNetworkDnsForwardingRulesetInner model =
            new VirtualNetworkDnsForwardingRulesetInner()
                .withId("fsnkymuctq")
                .withVirtualNetworkLink(new SubResource().withId("ebrjcxe"));
        model = BinaryData.fromObject(model).toObject(VirtualNetworkDnsForwardingRulesetInner.class);
        Assertions.assertEquals("fsnkymuctq", model.id());
        Assertions.assertEquals("ebrjcxe", model.virtualNetworkLink().id());
    }
}
