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

package com.azure.resourcemanager.hybridnetwork.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorNetworkFunctionInner;
import com.azure.resourcemanager.hybridnetwork.models.VendorNetworkFunctionListResult;
import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class VendorNetworkFunctionListResultTests {
    @Test
    public void testDeserialize() {
        VendorNetworkFunctionListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"provisioningState\":\"Unknown\",\"vendorProvisioningState\":\"UserDataValidationFailed\",\"skuName\":\"ujqgidok\",\"skuType\":\"SDWAN\",\"networkFunctionVendorConfigurations\":[]},\"id\":\"oxgvclt\",\"name\":\"gsncghkjeszz\",\"type\":\"bijhtxfvgxbf\"},{\"properties\":{\"provisioningState\":\"Failed\",\"vendorProvisioningState\":\"Deprovisioned\",\"skuName\":\"pvecxgodeb\",\"skuType\":\"Unknown\",\"networkFunctionVendorConfigurations\":[]},\"id\":\"bmpukgriwflz\",\"name\":\"fbxzpuzycisp\",\"type\":\"qzahmgkbrp\"},{\"properties\":{\"provisioningState\":\"Deleted\",\"vendorProvisioningState\":\"Provisioning\",\"skuName\":\"uqqkpik\",\"skuType\":\"EvolvedPacketCore\",\"networkFunctionVendorConfigurations\":[]},\"id\":\"tqagnbuynh\",\"name\":\"jggmebfsiarbu\",\"type\":\"rcvpnazzmhjrunmp\"},{\"properties\":{\"provisioningState\":\"Accepted\",\"vendorProvisioningState\":\"NotProvisioned\",\"skuName\":\"bnlankxmyskpb\",\"skuType\":\"Firewall\",\"networkFunctionVendorConfigurations\":[]},\"id\":\"kcxywnyt\",\"name\":\"rsyn\",\"type\":\"qidybyx\"}],\"nextLink\":\"fclhaaxdbabphlwr\"}")
                .toObject(VendorNetworkFunctionListResult.class);
        Assertions
            .assertEquals(
                VendorProvisioningState.USER_DATA_VALIDATION_FAILED, model.value().get(0).vendorProvisioningState());
    }

    @Test
    public void testSerialize() {
        VendorNetworkFunctionListResult model =
            new VendorNetworkFunctionListResult()
                .withValue(
                    Arrays
                        .asList(
                            new VendorNetworkFunctionInner()
                                .withVendorProvisioningState(VendorProvisioningState.USER_DATA_VALIDATION_FAILED)
                                .withNetworkFunctionVendorConfigurations(Arrays.asList()),
                            new VendorNetworkFunctionInner()
                                .withVendorProvisioningState(VendorProvisioningState.DEPROVISIONED)
                                .withNetworkFunctionVendorConfigurations(Arrays.asList()),
                            new VendorNetworkFunctionInner()
                                .withVendorProvisioningState(VendorProvisioningState.PROVISIONING)
                                .withNetworkFunctionVendorConfigurations(Arrays.asList()),
                            new VendorNetworkFunctionInner()
                                .withVendorProvisioningState(VendorProvisioningState.NOT_PROVISIONED)
                                .withNetworkFunctionVendorConfigurations(Arrays.asList())));
        model = BinaryData.fromObject(model).toObject(VendorNetworkFunctionListResult.class);
        Assertions
            .assertEquals(
                VendorProvisioningState.USER_DATA_VALIDATION_FAILED, model.value().get(0).vendorProvisioningState());
    }
}
