// 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.L3OptionAProperties;
import org.junit.jupiter.api.Assertions;

public final class L3OptionAPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        L3OptionAProperties model =
            BinaryData
                .fromString(
                    "{\"mtu\":707174583,\"vlanId\":1454825474,\"fabricASN\":5238881792700138972,\"peerASN\":8845842496565245250,\"bfdConfiguration\":{\"administrativeState\":\"MAT\",\"intervalInMilliSeconds\":1894816551,\"multiplier\":935663672},\"ingressAclId\":\"nasd\",\"egressAclId\":\"enz\"}")
                .toObject(L3OptionAProperties.class);
        Assertions.assertEquals(707174583, model.mtu());
        Assertions.assertEquals(1454825474, model.vlanId());
        Assertions.assertEquals(8845842496565245250L, model.peerAsn());
        Assertions.assertEquals(1894816551, model.bfdConfiguration().intervalInMilliSeconds());
        Assertions.assertEquals(935663672, model.bfdConfiguration().multiplier());
        Assertions.assertEquals("nasd", model.ingressAclId());
        Assertions.assertEquals("enz", model.egressAclId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        L3OptionAProperties model =
            new L3OptionAProperties()
                .withMtu(707174583)
                .withVlanId(1454825474)
                .withPeerAsn(8845842496565245250L)
                .withBfdConfiguration(
                    new BfdConfiguration().withIntervalInMilliSeconds(1894816551).withMultiplier(935663672))
                .withIngressAclId("nasd")
                .withEgressAclId("enz");
        model = BinaryData.fromObject(model).toObject(L3OptionAProperties.class);
        Assertions.assertEquals(707174583, model.mtu());
        Assertions.assertEquals(1454825474, model.vlanId());
        Assertions.assertEquals(8845842496565245250L, model.peerAsn());
        Assertions.assertEquals(1894816551, model.bfdConfiguration().intervalInMilliSeconds());
        Assertions.assertEquals(935663672, model.bfdConfiguration().multiplier());
        Assertions.assertEquals("nasd", model.ingressAclId());
        Assertions.assertEquals("enz", model.egressAclId());
    }
}
