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

package com.azure.resourcemanager.orbital.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.orbital.models.EndPoint;
import com.azure.resourcemanager.orbital.models.Protocol;
import org.junit.jupiter.api.Assertions;

public final class EndPointTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        EndPoint model =
            BinaryData
                .fromString(
                    "{\"ipAddress\":\"f\",\"endPointName\":\"y\",\"port\":\"osvexcsonpclhoc\",\"protocol\":\"UDP\"}")
                .toObject(EndPoint.class);
        Assertions.assertEquals("f", model.ipAddress());
        Assertions.assertEquals("y", model.endPointName());
        Assertions.assertEquals("osvexcsonpclhoc", model.port());
        Assertions.assertEquals(Protocol.UDP, model.protocol());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        EndPoint model =
            new EndPoint()
                .withIpAddress("f")
                .withEndPointName("y")
                .withPort("osvexcsonpclhoc")
                .withProtocol(Protocol.UDP);
        model = BinaryData.fromObject(model).toObject(EndPoint.class);
        Assertions.assertEquals("f", model.ipAddress());
        Assertions.assertEquals("y", model.endPointName());
        Assertions.assertEquals("osvexcsonpclhoc", model.port());
        Assertions.assertEquals(Protocol.UDP, model.protocol());
    }
}
