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

package com.azure.resourcemanager.storagecache.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.storagecache.models.CacheNetworkSettings;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class CacheNetworkSettingsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CacheNetworkSettings model =
            BinaryData
                .fromString(
                    "{\"mtu\":613009021,\"utilityAddresses\":[\"v\"],\"dnsServers\":[\"ynqwwncwzzhxgk\",\"rmgucnap\",\"t\"],\"dnsSearchDomain\":\"ellwptfdy\",\"ntpServer\":\"fqbuaceopzf\"}")
                .toObject(CacheNetworkSettings.class);
        Assertions.assertEquals(613009021, model.mtu());
        Assertions.assertEquals("ynqwwncwzzhxgk", model.dnsServers().get(0));
        Assertions.assertEquals("ellwptfdy", model.dnsSearchDomain());
        Assertions.assertEquals("fqbuaceopzf", model.ntpServer());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CacheNetworkSettings model =
            new CacheNetworkSettings()
                .withMtu(613009021)
                .withDnsServers(Arrays.asList("ynqwwncwzzhxgk", "rmgucnap", "t"))
                .withDnsSearchDomain("ellwptfdy")
                .withNtpServer("fqbuaceopzf");
        model = BinaryData.fromObject(model).toObject(CacheNetworkSettings.class);
        Assertions.assertEquals(613009021, model.mtu());
        Assertions.assertEquals("ynqwwncwzzhxgk", model.dnsServers().get(0));
        Assertions.assertEquals("ellwptfdy", model.dnsSearchDomain());
        Assertions.assertEquals("fqbuaceopzf", model.ntpServer());
    }
}
