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

public final class JpgLayerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        JpgLayer model =
            BinaryData
                .fromString(
                    "{\"quality\":1880007503,\"width\":\"cbtgnhnz\",\"height\":\"qxtjjfzqlqhyca\",\"label\":\"dggxdbeesmi\"}")
                .toObject(JpgLayer.class);
        Assertions.assertEquals("cbtgnhnz", model.width());
        Assertions.assertEquals("qxtjjfzqlqhyca", model.height());
        Assertions.assertEquals("dggxdbeesmi", model.label());
        Assertions.assertEquals(1880007503, model.quality());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        JpgLayer model =
            new JpgLayer()
                .withWidth("cbtgnhnz")
                .withHeight("qxtjjfzqlqhyca")
                .withLabel("dggxdbeesmi")
                .withQuality(1880007503);
        model = BinaryData.fromObject(model).toObject(JpgLayer.class);
        Assertions.assertEquals("cbtgnhnz", model.width());
        Assertions.assertEquals("qxtjjfzqlqhyca", model.height());
        Assertions.assertEquals("dggxdbeesmi", model.label());
        Assertions.assertEquals(1880007503, model.quality());
    }
}
