// 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.TrackPropertyCompareOperation;
import com.azure.resourcemanager.mediaservices.models.TrackPropertyCondition;
import com.azure.resourcemanager.mediaservices.models.TrackPropertyType;
import org.junit.jupiter.api.Assertions;

public final class TrackPropertyConditionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        TrackPropertyCondition model =
            BinaryData
                .fromString("{\"property\":\"FourCC\",\"operation\":\"Equal\",\"value\":\"ilzznfqqnvwp\"}")
                .toObject(TrackPropertyCondition.class);
        Assertions.assertEquals(TrackPropertyType.FOUR_CC, model.property());
        Assertions.assertEquals(TrackPropertyCompareOperation.EQUAL, model.operation());
        Assertions.assertEquals("ilzznfqqnvwp", model.value());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        TrackPropertyCondition model =
            new TrackPropertyCondition()
                .withProperty(TrackPropertyType.FOUR_CC)
                .withOperation(TrackPropertyCompareOperation.EQUAL)
                .withValue("ilzznfqqnvwp");
        model = BinaryData.fromObject(model).toObject(TrackPropertyCondition.class);
        Assertions.assertEquals(TrackPropertyType.FOUR_CC, model.property());
        Assertions.assertEquals(TrackPropertyCompareOperation.EQUAL, model.operation());
        Assertions.assertEquals("ilzznfqqnvwp", model.value());
    }
}
