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

public final class WorkloadNetworkSegmentSubnetTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        WorkloadNetworkSegmentSubnet model =
            BinaryData
                .fromString("{\"dhcpRanges\":[\"xhniskxfbkpycgk\",\"wndnhj\"],\"gatewayAddress\":\"uwhvylwzbtdhxujz\"}")
                .toObject(WorkloadNetworkSegmentSubnet.class);
        Assertions.assertEquals("xhniskxfbkpycgk", model.dhcpRanges().get(0));
        Assertions.assertEquals("uwhvylwzbtdhxujz", model.gatewayAddress());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        WorkloadNetworkSegmentSubnet model =
            new WorkloadNetworkSegmentSubnet()
                .withDhcpRanges(Arrays.asList("xhniskxfbkpycgk", "wndnhj"))
                .withGatewayAddress("uwhvylwzbtdhxujz");
        model = BinaryData.fromObject(model).toObject(WorkloadNetworkSegmentSubnet.class);
        Assertions.assertEquals("xhniskxfbkpycgk", model.dhcpRanges().get(0));
        Assertions.assertEquals("uwhvylwzbtdhxujz", model.gatewayAddress());
    }
}
