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

public final class ExternalNetworkPatchPropertiesOptionAPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ExternalNetworkPatchPropertiesOptionAProperties model =
            BinaryData
                .fromString(
                    "{\"mtu\":465055471,\"vlanId\":1999100319,\"fabricASN\":3083093657904489984,\"peerASN\":5237325054200645561,\"bfdConfiguration\":{\"administrativeState\":\"Enabled\",\"intervalInMilliSeconds\":610488087,\"multiplier\":81227364},\"ingressAclId\":\"skiioshjgczetybn\",\"egressAclId\":\"ztlcgc\",\"primaryIpv4Prefix\":\"chfjvmywjzebe\",\"primaryIpv6Prefix\":\"vlbefvwclj\",\"secondaryIpv4Prefix\":\"pylrwoxzgwpsy\",\"secondaryIpv6Prefix\":\"ijeypdvrbkerdkdk\"}")
                .toObject(ExternalNetworkPatchPropertiesOptionAProperties.class);
        Assertions.assertEquals("chfjvmywjzebe", model.primaryIpv4Prefix());
        Assertions.assertEquals("vlbefvwclj", model.primaryIpv6Prefix());
        Assertions.assertEquals("pylrwoxzgwpsy", model.secondaryIpv4Prefix());
        Assertions.assertEquals("ijeypdvrbkerdkdk", model.secondaryIpv6Prefix());
        Assertions.assertEquals(465055471, model.mtu());
        Assertions.assertEquals(1999100319, model.vlanId());
        Assertions.assertEquals(5237325054200645561L, model.peerAsn());
        Assertions.assertEquals(610488087, model.bfdConfiguration().intervalInMilliSeconds());
        Assertions.assertEquals(81227364, model.bfdConfiguration().multiplier());
        Assertions.assertEquals("skiioshjgczetybn", model.ingressAclId());
        Assertions.assertEquals("ztlcgc", model.egressAclId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ExternalNetworkPatchPropertiesOptionAProperties model =
            new ExternalNetworkPatchPropertiesOptionAProperties()
                .withPrimaryIpv4Prefix("chfjvmywjzebe")
                .withPrimaryIpv6Prefix("vlbefvwclj")
                .withSecondaryIpv4Prefix("pylrwoxzgwpsy")
                .withSecondaryIpv6Prefix("ijeypdvrbkerdkdk")
                .withMtu(465055471)
                .withVlanId(1999100319)
                .withPeerAsn(5237325054200645561L)
                .withBfdConfiguration(
                    new BfdConfiguration().withIntervalInMilliSeconds(610488087).withMultiplier(81227364))
                .withIngressAclId("skiioshjgczetybn")
                .withEgressAclId("ztlcgc");
        model = BinaryData.fromObject(model).toObject(ExternalNetworkPatchPropertiesOptionAProperties.class);
        Assertions.assertEquals("chfjvmywjzebe", model.primaryIpv4Prefix());
        Assertions.assertEquals("vlbefvwclj", model.primaryIpv6Prefix());
        Assertions.assertEquals("pylrwoxzgwpsy", model.secondaryIpv4Prefix());
        Assertions.assertEquals("ijeypdvrbkerdkdk", model.secondaryIpv6Prefix());
        Assertions.assertEquals(465055471, model.mtu());
        Assertions.assertEquals(1999100319, model.vlanId());
        Assertions.assertEquals(5237325054200645561L, model.peerAsn());
        Assertions.assertEquals(610488087, model.bfdConfiguration().intervalInMilliSeconds());
        Assertions.assertEquals(81227364, model.bfdConfiguration().multiplier());
        Assertions.assertEquals("skiioshjgczetybn", model.ingressAclId());
        Assertions.assertEquals("ztlcgc", model.egressAclId());
    }
}
