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

package com.azure.resourcemanager.managednetworkfabric.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType;
import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class IpGroupPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        IpGroupProperties model =
            BinaryData
                .fromString("{\"name\":\"ihclafzv\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"rsqqwztcm\",\"qkc\"]}")
                .toObject(IpGroupProperties.class);
        Assertions.assertEquals("ihclafzv", model.name());
        Assertions.assertEquals(IpAddressType.IPV4, model.ipAddressType());
        Assertions.assertEquals("rsqqwztcm", model.ipPrefixes().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        IpGroupProperties model =
            new IpGroupProperties()
                .withName("ihclafzv")
                .withIpAddressType(IpAddressType.IPV4)
                .withIpPrefixes(Arrays.asList("rsqqwztcm", "qkc"));
        model = BinaryData.fromObject(model).toObject(IpGroupProperties.class);
        Assertions.assertEquals("ihclafzv", model.name());
        Assertions.assertEquals(IpAddressType.IPV4, model.ipAddressType());
        Assertions.assertEquals("rsqqwztcm", model.ipPrefixes().get(0));
    }
}
