// 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.NetworkDeviceProperties;
import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleTypes;
import org.junit.jupiter.api.Assertions;

public final class NetworkDevicePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        NetworkDeviceProperties model =
            BinaryData
                .fromString(
                    "{\"version\":\"zh\",\"networkDeviceSku\":\"jbibg\",\"networkDeviceRole\":\"Management\",\"provisioningState\":\"Canceled\",\"networkRackId\":\"mv\",\"hostName\":\"luyovwxnbkfezzx\",\"serialNumber\":\"yhwzdgiruj\",\"annotation\":\"bomvzzbtdcqv\"}")
                .toObject(NetworkDeviceProperties.class);
        Assertions.assertEquals("bomvzzbtdcqv", model.annotation());
        Assertions.assertEquals("jbibg", model.networkDeviceSku());
        Assertions.assertEquals(NetworkDeviceRoleTypes.MANAGEMENT, model.networkDeviceRole());
        Assertions.assertEquals("luyovwxnbkfezzx", model.hostname());
        Assertions.assertEquals("yhwzdgiruj", model.serialNumber());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        NetworkDeviceProperties model =
            new NetworkDeviceProperties()
                .withAnnotation("bomvzzbtdcqv")
                .withNetworkDeviceSku("jbibg")
                .withNetworkDeviceRole(NetworkDeviceRoleTypes.MANAGEMENT)
                .withHostname("luyovwxnbkfezzx")
                .withSerialNumber("yhwzdgiruj");
        model = BinaryData.fromObject(model).toObject(NetworkDeviceProperties.class);
        Assertions.assertEquals("bomvzzbtdcqv", model.annotation());
        Assertions.assertEquals("jbibg", model.networkDeviceSku());
        Assertions.assertEquals(NetworkDeviceRoleTypes.MANAGEMENT, model.networkDeviceRole());
        Assertions.assertEquals("luyovwxnbkfezzx", model.hostname());
        Assertions.assertEquals("yhwzdgiruj", model.serialNumber());
    }
}
