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

package com.azure.resourcemanager.vmwarecloudsimple.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.vmwarecloudsimple.models.GuestOsnicCustomization;
import com.azure.resourcemanager.vmwarecloudsimple.models.GuestOsnicCustomizationAllocation;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class GuestOsnicCustomizationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        GuestOsnicCustomization model =
            BinaryData
                .fromString(
                    "{\"allocation\":\"dynamic\",\"dnsServers\":[\"jhxbld\"],\"gateway\":[\"wrlkdmtn\",\"vokotllxdyh\",\"syocogjltdtbnnha\"],\"ipAddress\":\"ocrkvcikh\",\"mask\":\"p\",\"primaryWinsServer\":\"qgxqquezikyw\",\"secondaryWinsServer\":\"xkalla\"}")
                .toObject(GuestOsnicCustomization.class);
        Assertions.assertEquals(GuestOsnicCustomizationAllocation.DYNAMIC, model.allocation());
        Assertions.assertEquals("jhxbld", model.dnsServers().get(0));
        Assertions.assertEquals("wrlkdmtn", model.gateway().get(0));
        Assertions.assertEquals("ocrkvcikh", model.ipAddress());
        Assertions.assertEquals("p", model.mask());
        Assertions.assertEquals("qgxqquezikyw", model.primaryWinsServer());
        Assertions.assertEquals("xkalla", model.secondaryWinsServer());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        GuestOsnicCustomization model =
            new GuestOsnicCustomization()
                .withAllocation(GuestOsnicCustomizationAllocation.DYNAMIC)
                .withDnsServers(Arrays.asList("jhxbld"))
                .withGateway(Arrays.asList("wrlkdmtn", "vokotllxdyh", "syocogjltdtbnnha"))
                .withIpAddress("ocrkvcikh")
                .withMask("p")
                .withPrimaryWinsServer("qgxqquezikyw")
                .withSecondaryWinsServer("xkalla");
        model = BinaryData.fromObject(model).toObject(GuestOsnicCustomization.class);
        Assertions.assertEquals(GuestOsnicCustomizationAllocation.DYNAMIC, model.allocation());
        Assertions.assertEquals("jhxbld", model.dnsServers().get(0));
        Assertions.assertEquals("wrlkdmtn", model.gateway().get(0));
        Assertions.assertEquals("ocrkvcikh", model.ipAddress());
        Assertions.assertEquals("p", model.mask());
        Assertions.assertEquals("qgxqquezikyw", model.primaryWinsServer());
        Assertions.assertEquals("xkalla", model.secondaryWinsServer());
    }
}
