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

package com.azure.resourcemanager.baremetalinfrastructure.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.baremetalinfrastructure.models.IpAddress;
import com.azure.resourcemanager.baremetalinfrastructure.models.NetworkProfile;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class NetworkProfileTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        NetworkProfile model =
            BinaryData
                .fromString(
                    "{\"networkInterfaces\":[{\"ipAddress\":\"j\"},{\"ipAddress\":\"hbcryffdfdosyge\"}],\"circuitId\":\"aojakhmsbzjhcrz\"}")
                .toObject(NetworkProfile.class);
        Assertions.assertEquals("j", model.networkInterfaces().get(0).ipAddress());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        NetworkProfile model =
            new NetworkProfile()
                .withNetworkInterfaces(
                    Arrays
                        .asList(new IpAddress().withIpAddress("j"), new IpAddress().withIpAddress("hbcryffdfdosyge")));
        model = BinaryData.fromObject(model).toObject(NetworkProfile.class);
        Assertions.assertEquals("j", model.networkInterfaces().get(0).ipAddress());
    }
}
