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

package com.azure.resourcemanager.networkcloud.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.networkcloud.models.BfdEnabled;
import com.azure.resourcemanager.networkcloud.models.IpAddressPool;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class IpAddressPoolTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        IpAddressPool model =
            BinaryData
                .fromString(
                    "{\"addresses\":[\"lsa\",\"nynfsynljphuo\",\"xodlqiyntorzih\",\"eosjswsr\"],\"autoAssign\":\"False\",\"name\":\"yzrpzbchckqqzq\",\"onlyUseHostIps\":\"True\"}")
                .toObject(IpAddressPool.class);
        Assertions.assertEquals("lsa", model.addresses().get(0));
        Assertions.assertEquals(BfdEnabled.FALSE, model.autoAssign());
        Assertions.assertEquals("yzrpzbchckqqzq", model.name());
        Assertions.assertEquals(BfdEnabled.TRUE, model.onlyUseHostIps());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        IpAddressPool model =
            new IpAddressPool()
                .withAddresses(Arrays.asList("lsa", "nynfsynljphuo", "xodlqiyntorzih", "eosjswsr"))
                .withAutoAssign(BfdEnabled.FALSE)
                .withName("yzrpzbchckqqzq")
                .withOnlyUseHostIps(BfdEnabled.TRUE);
        model = BinaryData.fromObject(model).toObject(IpAddressPool.class);
        Assertions.assertEquals("lsa", model.addresses().get(0));
        Assertions.assertEquals(BfdEnabled.FALSE, model.autoAssign());
        Assertions.assertEquals("yzrpzbchckqqzq", model.name());
        Assertions.assertEquals(BfdEnabled.TRUE, model.onlyUseHostIps());
    }
}
