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

package com.azure.resourcemanager.costmanagement.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.costmanagement.models.OperatorType;
import com.azure.resourcemanager.costmanagement.models.ReportConfigComparisonExpression;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ReportConfigComparisonExpressionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ReportConfigComparisonExpression model =
            BinaryData
                .fromString(
                    "{\"name\":\"deicbtwnpzao\",\"operator\":\"Contains\",\"values\":[\"hrhcffcyddglmjth\",\"qkwpyeicxmqc\",\"wqvhkhixuigdt\",\"pbobjo\"]}")
                .toObject(ReportConfigComparisonExpression.class);
        Assertions.assertEquals("deicbtwnpzao", model.name());
        Assertions.assertEquals(OperatorType.CONTAINS, model.operator());
        Assertions.assertEquals("hrhcffcyddglmjth", model.values().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ReportConfigComparisonExpression model =
            new ReportConfigComparisonExpression()
                .withName("deicbtwnpzao")
                .withOperator(OperatorType.CONTAINS)
                .withValues(Arrays.asList("hrhcffcyddglmjth", "qkwpyeicxmqc", "wqvhkhixuigdt", "pbobjo"));
        model = BinaryData.fromObject(model).toObject(ReportConfigComparisonExpression.class);
        Assertions.assertEquals("deicbtwnpzao", model.name());
        Assertions.assertEquals(OperatorType.CONTAINS, model.operator());
        Assertions.assertEquals("hrhcffcyddglmjth", model.values().get(0));
    }
}
