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

package com.azure.resourcemanager.databoxedge.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.databoxedge.models.NetworkAdapter;
import com.azure.resourcemanager.databoxedge.models.NetworkAdapterDhcpStatus;
import com.azure.resourcemanager.databoxedge.models.NetworkAdapterRdmaStatus;
import org.junit.jupiter.api.Assertions;

public final class NetworkAdapterTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        NetworkAdapter model =
            BinaryData
                .fromString(
                    "{\"adapterId\":\"wbavxbniwdj\",\"adapterPosition\":{\"networkGroup\":\"RDMA\",\"port\":670634549},\"index\":551724215,\"nodeId\":\"nxytxh\",\"networkAdapterName\":\"xbzpfzab\",\"label\":\"cuh\",\"macAddress\":\"tcty\",\"linkSpeed\":3791870776302603545,\"status\":\"Inactive\",\"rdmaStatus\":\"Incapable\",\"dhcpStatus\":\"Enabled\",\"ipv4Configuration\":{\"ipAddress\":\"bhvgy\",\"subnet\":\"uosvmkfssxqukk\",\"gateway\":\"l\"},\"ipv6Configuration\":{\"ipAddress\":\"sxnkjzkdeslpvlo\",\"prefixLength\":158765093,\"gateway\":\"ighxpk\"},\"ipv6LinkLocalAddress\":\"zb\",\"dnsServers\":[\"ebb\",\"umnyqu\",\"edeojnabc\"]}")
                .toObject(NetworkAdapter.class);
        Assertions.assertEquals(NetworkAdapterRdmaStatus.INCAPABLE, model.rdmaStatus());
        Assertions.assertEquals(NetworkAdapterDhcpStatus.ENABLED, model.dhcpStatus());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        NetworkAdapter model =
            new NetworkAdapter()
                .withRdmaStatus(NetworkAdapterRdmaStatus.INCAPABLE)
                .withDhcpStatus(NetworkAdapterDhcpStatus.ENABLED);
        model = BinaryData.fromObject(model).toObject(NetworkAdapter.class);
        Assertions.assertEquals(NetworkAdapterRdmaStatus.INCAPABLE, model.rdmaStatus());
        Assertions.assertEquals(NetworkAdapterDhcpStatus.ENABLED, model.dhcpStatus());
    }
}
