// 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.InboundNatRule;
import com.azure.resourcemanager.devtestlabs.models.TransportProtocol;
import org.junit.jupiter.api.Assertions;

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

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