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

package com.azure.resourcemanager.avs.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneProperties;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class WorkloadNetworkDnsZonePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        WorkloadNetworkDnsZoneProperties model =
            BinaryData
                .fromString(
                    "{\"displayName\":\"yrs\",\"domain\":[\"ytgadgvraeaene\",\"nzar\",\"wlquuijfqkace\"],\"dnsServerIps\":[\"pfpubjibww\",\"f\"],\"sourceIp\":\"hqkvpuvksgplsak\",\"dnsServices\":146947872271189543,\"provisioningState\":\"Building\",\"revision\":2482302250486318586}")
                .toObject(WorkloadNetworkDnsZoneProperties.class);
        Assertions.assertEquals("yrs", model.displayName());
        Assertions.assertEquals("ytgadgvraeaene", model.domain().get(0));
        Assertions.assertEquals("pfpubjibww", model.dnsServerIps().get(0));
        Assertions.assertEquals("hqkvpuvksgplsak", model.sourceIp());
        Assertions.assertEquals(146947872271189543L, model.dnsServices());
        Assertions.assertEquals(2482302250486318586L, model.revision());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        WorkloadNetworkDnsZoneProperties model =
            new WorkloadNetworkDnsZoneProperties()
                .withDisplayName("yrs")
                .withDomain(Arrays.asList("ytgadgvraeaene", "nzar", "wlquuijfqkace"))
                .withDnsServerIps(Arrays.asList("pfpubjibww", "f"))
                .withSourceIp("hqkvpuvksgplsak")
                .withDnsServices(146947872271189543L)
                .withRevision(2482302250486318586L);
        model = BinaryData.fromObject(model).toObject(WorkloadNetworkDnsZoneProperties.class);
        Assertions.assertEquals("yrs", model.displayName());
        Assertions.assertEquals("ytgadgvraeaene", model.domain().get(0));
        Assertions.assertEquals("pfpubjibww", model.dnsServerIps().get(0));
        Assertions.assertEquals("hqkvpuvksgplsak", model.sourceIp());
        Assertions.assertEquals(146947872271189543L, model.dnsServices());
        Assertions.assertEquals(2482302250486318586L, model.revision());
    }
}
