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

public final class OptionAPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OptionAProperties model =
            BinaryData
                .fromString(
                    "{\"mtu\":672281417,\"vlanId\":772220460,\"peerASN\":811259907,\"bfdConfiguration\":{\"interval\":1114052241,\"multiplier\":873117739},\"primaryIpv4Prefix\":\"gsh\",\"primaryIpv6Prefix\":\"gsgbpfgzdjt\",\"secondaryIpv4Prefix\":\"zflbqvg\",\"secondaryIpv6Prefix\":\"vl\"}")
                .toObject(OptionAProperties.class);
        Assertions.assertEquals("gsh", model.primaryIpv4Prefix());
        Assertions.assertEquals("gsgbpfgzdjt", model.primaryIpv6Prefix());
        Assertions.assertEquals("zflbqvg", model.secondaryIpv4Prefix());
        Assertions.assertEquals("vl", model.secondaryIpv6Prefix());
        Assertions.assertEquals(672281417, model.mtu());
        Assertions.assertEquals(772220460, model.vlanId());
        Assertions.assertEquals(811259907, model.peerAsn());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OptionAProperties model =
            new OptionAProperties()
                .withPrimaryIpv4Prefix("gsh")
                .withPrimaryIpv6Prefix("gsgbpfgzdjt")
                .withSecondaryIpv4Prefix("zflbqvg")
                .withSecondaryIpv6Prefix("vl")
                .withMtu(672281417)
                .withVlanId(772220460)
                .withPeerAsn(811259907)
                .withBfdConfiguration(new FabricBfdConfiguration());
        model = BinaryData.fromObject(model).toObject(OptionAProperties.class);
        Assertions.assertEquals("gsh", model.primaryIpv4Prefix());
        Assertions.assertEquals("gsgbpfgzdjt", model.primaryIpv6Prefix());
        Assertions.assertEquals("zflbqvg", model.secondaryIpv4Prefix());
        Assertions.assertEquals("vl", model.secondaryIpv6Prefix());
        Assertions.assertEquals(672281417, model.mtu());
        Assertions.assertEquals(772220460, model.vlanId());
        Assertions.assertEquals(811259907, model.peerAsn());
    }
}
