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

package com.azure.resourcemanager.devtestlabs.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.devtestlabs.models.Port;
import com.azure.resourcemanager.devtestlabs.models.TransportProtocol;
import org.junit.jupiter.api.Assertions;

public final class PortTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        Port model =
            BinaryData.fromString("{\"transportProtocol\":\"Udp\",\"backendPort\":1684685250}").toObject(Port.class);
        Assertions.assertEquals(TransportProtocol.UDP, model.transportProtocol());
        Assertions.assertEquals(1684685250, model.backendPort());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        Port model = new Port().withTransportProtocol(TransportProtocol.UDP).withBackendPort(1684685250);
        model = BinaryData.fromObject(model).toObject(Port.class);
        Assertions.assertEquals(TransportProtocol.UDP, model.transportProtocol());
        Assertions.assertEquals(1684685250, model.backendPort());
    }
}
