// 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.FilterTrackPropertyCompareOperation;
import com.azure.resourcemanager.mediaservices.models.FilterTrackPropertyCondition;
import com.azure.resourcemanager.mediaservices.models.FilterTrackPropertyType;
import org.junit.jupiter.api.Assertions;

public final class FilterTrackPropertyConditionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        FilterTrackPropertyCondition model =
            BinaryData
                .fromString("{\"property\":\"FourCC\",\"value\":\"smy\",\"operation\":\"Equal\"}")
                .toObject(FilterTrackPropertyCondition.class);
        Assertions.assertEquals(FilterTrackPropertyType.FOUR_CC, model.property());
        Assertions.assertEquals("smy", model.value());
        Assertions.assertEquals(FilterTrackPropertyCompareOperation.EQUAL, model.operation());
    }

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