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

package com.azure.resourcemanager.mediaservices.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.mediaservices.models.AacAudio;
import com.azure.resourcemanager.mediaservices.models.AacAudioProfile;
import org.junit.jupiter.api.Assertions;

public final class AacAudioTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AacAudio model =
            BinaryData
                .fromString(
                    "{\"@odata.type\":\"#Microsoft.Media.AacAudio\",\"profile\":\"HeAacV2\",\"channels\":1448184483,\"samplingRate\":1746749164,\"bitrate\":1933702310,\"label\":\"bbdaxco\"}")
                .toObject(AacAudio.class);
        Assertions.assertEquals("bbdaxco", model.label());
        Assertions.assertEquals(1448184483, model.channels());
        Assertions.assertEquals(1746749164, model.samplingRate());
        Assertions.assertEquals(1933702310, model.bitrate());
        Assertions.assertEquals(AacAudioProfile.HE_AAC_V2, model.profile());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AacAudio model =
            new AacAudio()
                .withLabel("bbdaxco")
                .withChannels(1448184483)
                .withSamplingRate(1746749164)
                .withBitrate(1933702310)
                .withProfile(AacAudioProfile.HE_AAC_V2);
        model = BinaryData.fromObject(model).toObject(AacAudio.class);
        Assertions.assertEquals("bbdaxco", model.label());
        Assertions.assertEquals(1448184483, model.channels());
        Assertions.assertEquals(1746749164, model.samplingRate());
        Assertions.assertEquals(1933702310, model.bitrate());
        Assertions.assertEquals(AacAudioProfile.HE_AAC_V2, model.profile());
    }
}
