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

package com.azure.resourcemanager.peering.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.peering.models.DirectPeeringFacility;
import com.azure.resourcemanager.peering.models.DirectPeeringType;
import org.junit.jupiter.api.Assertions;

public final class DirectPeeringFacilityTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DirectPeeringFacility model =
            BinaryData
                .fromString(
                    "{\"address\":\"ihkaetcktvfc\",\"directPeeringType\":\"Cdn\",\"peeringDBFacilityId\":1960016252,\"peeringDBFacilityLink\":\"ymuctqhjfbebrj\"}")
                .toObject(DirectPeeringFacility.class);
        Assertions.assertEquals("ihkaetcktvfc", model.address());
        Assertions.assertEquals(DirectPeeringType.CDN, model.directPeeringType());
        Assertions.assertEquals(1960016252, model.peeringDBFacilityId());
        Assertions.assertEquals("ymuctqhjfbebrj", model.peeringDBFacilityLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DirectPeeringFacility model =
            new DirectPeeringFacility()
                .withAddress("ihkaetcktvfc")
                .withDirectPeeringType(DirectPeeringType.CDN)
                .withPeeringDBFacilityId(1960016252)
                .withPeeringDBFacilityLink("ymuctqhjfbebrj");
        model = BinaryData.fromObject(model).toObject(DirectPeeringFacility.class);
        Assertions.assertEquals("ihkaetcktvfc", model.address());
        Assertions.assertEquals(DirectPeeringType.CDN, model.directPeeringType());
        Assertions.assertEquals(1960016252, model.peeringDBFacilityId());
        Assertions.assertEquals("ymuctqhjfbebrj", model.peeringDBFacilityLink());
    }
}
