// 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.fluent.models.NetworkToNetworkInterconnectInner;
import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty;
import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnectsList;
import com.azure.resourcemanager.managednetworkfabric.models.NniType;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class NetworkToNetworkInterconnectsListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        NetworkToNetworkInterconnectsList model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"nniType\":\"NPB\",\"administrativeState\":\"Disabled\",\"isManagementType\":\"True\",\"useOptionB\":\"False\",\"provisioningState\":\"Canceled\"},\"id\":\"esmkssjhoiftxfkf\",\"name\":\"egprhptil\",\"type\":\"ucb\"},{\"properties\":{\"nniType\":\"CE\",\"administrativeState\":\"Enabled\",\"isManagementType\":\"True\",\"useOptionB\":\"True\",\"provisioningState\":\"Updating\"},\"id\":\"drizetpwbr\",\"name\":\"lllibph\",\"type\":\"qzmiza\"}],\"nextLink\":\"kan\"}")
                .toObject(NetworkToNetworkInterconnectsList.class);
        Assertions.assertEquals(NniType.NPB, model.value().get(0).nniType());
        Assertions.assertEquals(BooleanEnumProperty.TRUE, model.value().get(0).isManagementType());
        Assertions.assertEquals(BooleanEnumProperty.FALSE, model.value().get(0).useOptionB());
        Assertions.assertEquals("kan", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        NetworkToNetworkInterconnectsList model =
            new NetworkToNetworkInterconnectsList()
                .withValue(
                    Arrays
                        .asList(
                            new NetworkToNetworkInterconnectInner()
                                .withNniType(NniType.NPB)
                                .withIsManagementType(BooleanEnumProperty.TRUE)
                                .withUseOptionB(BooleanEnumProperty.FALSE),
                            new NetworkToNetworkInterconnectInner()
                                .withNniType(NniType.CE)
                                .withIsManagementType(BooleanEnumProperty.TRUE)
                                .withUseOptionB(BooleanEnumProperty.TRUE)))
                .withNextLink("kan");
        model = BinaryData.fromObject(model).toObject(NetworkToNetworkInterconnectsList.class);
        Assertions.assertEquals(NniType.NPB, model.value().get(0).nniType());
        Assertions.assertEquals(BooleanEnumProperty.TRUE, model.value().get(0).isManagementType());
        Assertions.assertEquals(BooleanEnumProperty.FALSE, model.value().get(0).useOptionB());
        Assertions.assertEquals("kan", model.nextLink());
    }
}
