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

public final class VpnConfigurationPropertiesOptionAPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        VpnConfigurationPropertiesOptionAProperties model =
            BinaryData
                .fromString(
                    "{\"primaryIpv4Prefix\":\"fdrld\",\"primaryIpv6Prefix\":\"ehi\",\"secondaryIpv4Prefix\":\"ttugyu\",\"secondaryIpv6Prefix\":\"rldaxurfqa\",\"mtu\":1770378356,\"vlanId\":270505616,\"peerASN\":8741394680932832379,\"bfdConfiguration\":{\"administrativeState\":\"MAT\",\"intervalInMilliSeconds\":1911629165,\"multiplier\":833458664}}")
                .toObject(VpnConfigurationPropertiesOptionAProperties.class);
        Assertions.assertEquals(1770378356, model.mtu());
        Assertions.assertEquals(270505616, model.vlanId());
        Assertions.assertEquals(8741394680932832379L, model.peerAsn());
        Assertions.assertEquals(1911629165, model.bfdConfiguration().intervalInMilliSeconds());
        Assertions.assertEquals(833458664, model.bfdConfiguration().multiplier());
        Assertions.assertEquals("fdrld", model.primaryIpv4Prefix());
        Assertions.assertEquals("ehi", model.primaryIpv6Prefix());
        Assertions.assertEquals("ttugyu", model.secondaryIpv4Prefix());
        Assertions.assertEquals("rldaxurfqa", model.secondaryIpv6Prefix());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        VpnConfigurationPropertiesOptionAProperties model =
            new VpnConfigurationPropertiesOptionAProperties()
                .withMtu(1770378356)
                .withVlanId(270505616)
                .withPeerAsn(8741394680932832379L)
                .withBfdConfiguration(
                    new BfdConfiguration().withIntervalInMilliSeconds(1911629165).withMultiplier(833458664))
                .withPrimaryIpv4Prefix("fdrld")
                .withPrimaryIpv6Prefix("ehi")
                .withSecondaryIpv4Prefix("ttugyu")
                .withSecondaryIpv6Prefix("rldaxurfqa");
        model = BinaryData.fromObject(model).toObject(VpnConfigurationPropertiesOptionAProperties.class);
        Assertions.assertEquals(1770378356, model.mtu());
        Assertions.assertEquals(270505616, model.vlanId());
        Assertions.assertEquals(8741394680932832379L, model.peerAsn());
        Assertions.assertEquals(1911629165, model.bfdConfiguration().intervalInMilliSeconds());
        Assertions.assertEquals(833458664, model.bfdConfiguration().multiplier());
        Assertions.assertEquals("fdrld", model.primaryIpv4Prefix());
        Assertions.assertEquals("ehi", model.primaryIpv6Prefix());
        Assertions.assertEquals("ttugyu", model.secondaryIpv4Prefix());
        Assertions.assertEquals("rldaxurfqa", model.secondaryIpv6Prefix());
    }
}
