// 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.ContactProfileLinkChannel;
import com.azure.resourcemanager.orbital.models.EndPoint;
import com.azure.resourcemanager.orbital.models.Protocol;
import org.junit.jupiter.api.Assertions;

public final class ContactProfileLinkChannelTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ContactProfileLinkChannel model =
            BinaryData
                .fromString(
                    "{\"name\":\"iqzbq\",\"centerFrequencyMHz\":60.36864,\"bandwidthMHz\":82.09639,\"endPoint\":{\"ipAddress\":\"ovm\",\"endPointName\":\"okacspk\",\"port\":\"lhzdobp\",\"protocol\":\"UDP\"},\"modulationConfiguration\":\"flbvvnchrkcciwwz\",\"demodulationConfiguration\":\"qkhr\",\"encodingConfiguration\":\"jiwkuofoskghsau\",\"decodingConfiguration\":\"mjmvxieduugidyjr\"}")
                .toObject(ContactProfileLinkChannel.class);
        Assertions.assertEquals("iqzbq", model.name());
        Assertions.assertEquals(60.36864f, model.centerFrequencyMHz());
        Assertions.assertEquals(82.09639f, model.bandwidthMHz());
        Assertions.assertEquals("ovm", model.endPoint().ipAddress());
        Assertions.assertEquals("okacspk", model.endPoint().endPointName());
        Assertions.assertEquals("lhzdobp", model.endPoint().port());
        Assertions.assertEquals(Protocol.UDP, model.endPoint().protocol());
        Assertions.assertEquals("flbvvnchrkcciwwz", model.modulationConfiguration());
        Assertions.assertEquals("qkhr", model.demodulationConfiguration());
        Assertions.assertEquals("jiwkuofoskghsau", model.encodingConfiguration());
        Assertions.assertEquals("mjmvxieduugidyjr", model.decodingConfiguration());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ContactProfileLinkChannel model =
            new ContactProfileLinkChannel()
                .withName("iqzbq")
                .withCenterFrequencyMHz(60.36864f)
                .withBandwidthMHz(82.09639f)
                .withEndPoint(
                    new EndPoint()
                        .withIpAddress("ovm")
                        .withEndPointName("okacspk")
                        .withPort("lhzdobp")
                        .withProtocol(Protocol.UDP))
                .withModulationConfiguration("flbvvnchrkcciwwz")
                .withDemodulationConfiguration("qkhr")
                .withEncodingConfiguration("jiwkuofoskghsau")
                .withDecodingConfiguration("mjmvxieduugidyjr");
        model = BinaryData.fromObject(model).toObject(ContactProfileLinkChannel.class);
        Assertions.assertEquals("iqzbq", model.name());
        Assertions.assertEquals(60.36864f, model.centerFrequencyMHz());
        Assertions.assertEquals(82.09639f, model.bandwidthMHz());
        Assertions.assertEquals("ovm", model.endPoint().ipAddress());
        Assertions.assertEquals("okacspk", model.endPoint().endPointName());
        Assertions.assertEquals("lhzdobp", model.endPoint().port());
        Assertions.assertEquals(Protocol.UDP, model.endPoint().protocol());
        Assertions.assertEquals("flbvvnchrkcciwwz", model.modulationConfiguration());
        Assertions.assertEquals("qkhr", model.demodulationConfiguration());
        Assertions.assertEquals("jiwkuofoskghsau", model.encodingConfiguration());
        Assertions.assertEquals("mjmvxieduugidyjr", model.decodingConfiguration());
    }
}
