// 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.ForecastComparisonExpression;
import com.azure.resourcemanager.costmanagement.models.ForecastOperatorType;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ForecastComparisonExpressionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ForecastComparisonExpression model =
            BinaryData
                .fromString("{\"name\":\"euojgjrwju\",\"operator\":\"In\",\"values\":[\"twm\",\"dytdxwitx\"]}")
                .toObject(ForecastComparisonExpression.class);
        Assertions.assertEquals("euojgjrwju", model.name());
        Assertions.assertEquals(ForecastOperatorType.IN, model.operator());
        Assertions.assertEquals("twm", model.values().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ForecastComparisonExpression model =
            new ForecastComparisonExpression()
                .withName("euojgjrwju")
                .withOperator(ForecastOperatorType.IN)
                .withValues(Arrays.asList("twm", "dytdxwitx"));
        model = BinaryData.fromObject(model).toObject(ForecastComparisonExpression.class);
        Assertions.assertEquals("euojgjrwju", model.name());
        Assertions.assertEquals(ForecastOperatorType.IN, model.operator());
        Assertions.assertEquals("twm", model.values().get(0));
    }
}
