// 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.FunctionType;
import com.azure.resourcemanager.costmanagement.models.ReportConfigAggregation;
import org.junit.jupiter.api.Assertions;

public final class ReportConfigAggregationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ReportConfigAggregation model =
            BinaryData.fromString("{\"name\":\"ocpcy\",\"function\":\"Sum\"}").toObject(ReportConfigAggregation.class);
        Assertions.assertEquals("ocpcy", model.name());
        Assertions.assertEquals(FunctionType.SUM, model.function());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ReportConfigAggregation model = new ReportConfigAggregation().withName("ocpcy").withFunction(FunctionType.SUM);
        model = BinaryData.fromObject(model).toObject(ReportConfigAggregation.class);
        Assertions.assertEquals("ocpcy", model.name());
        Assertions.assertEquals(FunctionType.SUM, model.function());
    }
}
