// 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.VideoLayer;
import org.junit.jupiter.api.Assertions;

public final class VideoLayerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        VideoLayer model =
            BinaryData
                .fromString(
                    "{\"bitrate\":1713301534,\"maxBitrate\":1058689711,\"bFrames\":698504930,\"frameRate\":\"wchpxlk\",\"slices\":17628020,\"adaptiveBFrame\":true,\"width\":\"ycslevufuztcktyh\",\"height\":\"qedcgzulwm\",\"label\":\"qzz\"}")
                .toObject(VideoLayer.class);
        Assertions.assertEquals("ycslevufuztcktyh", model.width());
        Assertions.assertEquals("qedcgzulwm", model.height());
        Assertions.assertEquals("qzz", model.label());
        Assertions.assertEquals(1713301534, model.bitrate());
        Assertions.assertEquals(1058689711, model.maxBitrate());
        Assertions.assertEquals(698504930, model.bFrames());
        Assertions.assertEquals("wchpxlk", model.frameRate());
        Assertions.assertEquals(17628020, model.slices());
        Assertions.assertEquals(true, model.adaptiveBFrame());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        VideoLayer model =
            new VideoLayer()
                .withWidth("ycslevufuztcktyh")
                .withHeight("qedcgzulwm")
                .withLabel("qzz")
                .withBitrate(1713301534)
                .withMaxBitrate(1058689711)
                .withBFrames(698504930)
                .withFrameRate("wchpxlk")
                .withSlices(17628020)
                .withAdaptiveBFrame(true);
        model = BinaryData.fromObject(model).toObject(VideoLayer.class);
        Assertions.assertEquals("ycslevufuztcktyh", model.width());
        Assertions.assertEquals("qedcgzulwm", model.height());
        Assertions.assertEquals("qzz", model.label());
        Assertions.assertEquals(1713301534, model.bitrate());
        Assertions.assertEquals(1058689711, model.maxBitrate());
        Assertions.assertEquals(698504930, model.bFrames());
        Assertions.assertEquals("wchpxlk", model.frameRate());
        Assertions.assertEquals(17628020, model.slices());
        Assertions.assertEquals(true, model.adaptiveBFrame());
    }
}
