// 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.WorkloadNetworkDnsZoneInner;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class WorkloadNetworkDnsZoneInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        WorkloadNetworkDnsZoneInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"displayName\":\"bwoenwashrt\",\"domain\":[\"cnqxwbpokulpi\",\"jwaa\",\"ipqiiobyuqerpq\"],\"dnsServerIps\":[\"wcciuqgbdbu\",\"auvfbtkuwhhmhyk\"],\"sourceIp\":\"oxafn\",\"dnsServices\":6257621363214543247,\"provisioningState\":\"Updating\",\"revision\":7042197231037180697},\"id\":\"ymkcdyhb\",\"name\":\"kkpwdreqnovvq\",\"type\":\"ovljxywsu\"}")
                .toObject(WorkloadNetworkDnsZoneInner.class);
        Assertions.assertEquals("bwoenwashrt", model.displayName());
        Assertions.assertEquals("cnqxwbpokulpi", model.domain().get(0));
        Assertions.assertEquals("wcciuqgbdbu", model.dnsServerIps().get(0));
        Assertions.assertEquals("oxafn", model.sourceIp());
        Assertions.assertEquals(6257621363214543247L, model.dnsServices());
        Assertions.assertEquals(7042197231037180697L, model.revision());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        WorkloadNetworkDnsZoneInner model =
            new WorkloadNetworkDnsZoneInner()
                .withDisplayName("bwoenwashrt")
                .withDomain(Arrays.asList("cnqxwbpokulpi", "jwaa", "ipqiiobyuqerpq"))
                .withDnsServerIps(Arrays.asList("wcciuqgbdbu", "auvfbtkuwhhmhyk"))
                .withSourceIp("oxafn")
                .withDnsServices(6257621363214543247L)
                .withRevision(7042197231037180697L);
        model = BinaryData.fromObject(model).toObject(WorkloadNetworkDnsZoneInner.class);
        Assertions.assertEquals("bwoenwashrt", model.displayName());
        Assertions.assertEquals("cnqxwbpokulpi", model.domain().get(0));
        Assertions.assertEquals("wcciuqgbdbu", model.dnsServerIps().get(0));
        Assertions.assertEquals("oxafn", model.sourceIp());
        Assertions.assertEquals(6257621363214543247L, model.dnsServices());
        Assertions.assertEquals(7042197231037180697L, model.revision());
    }
}
