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

package com.azure.resourcemanager.security.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.security.models.EffectiveNetworkSecurityGroups;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class EffectiveNetworkSecurityGroupsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        EffectiveNetworkSecurityGroups model =
            BinaryData
                .fromString(
                    "{\"networkInterface\":\"aeranokqgukkjqnv\",\"networkSecurityGroups\":[\"ylaxxulcdi\",\"dosfjbjsvgjrw\"]}")
                .toObject(EffectiveNetworkSecurityGroups.class);
        Assertions.assertEquals("aeranokqgukkjqnv", model.networkInterface());
        Assertions.assertEquals("ylaxxulcdi", model.networkSecurityGroups().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        EffectiveNetworkSecurityGroups model =
            new EffectiveNetworkSecurityGroups()
                .withNetworkInterface("aeranokqgukkjqnv")
                .withNetworkSecurityGroups(Arrays.asList("ylaxxulcdi", "dosfjbjsvgjrw"));
        model = BinaryData.fromObject(model).toObject(EffectiveNetworkSecurityGroups.class);
        Assertions.assertEquals("aeranokqgukkjqnv", model.networkInterface());
        Assertions.assertEquals("ylaxxulcdi", model.networkSecurityGroups().get(0));
    }
}
