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

public final class ExportDatasetTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ExportDataset model =
            BinaryData
                .fromString("{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"bjj\",\"anvx\"]}}")
                .toObject(ExportDataset.class);
        Assertions.assertEquals(GranularityType.DAILY, model.granularity());
        Assertions.assertEquals("bjj", model.configuration().columns().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ExportDataset model =
            new ExportDataset()
                .withGranularity(GranularityType.DAILY)
                .withConfiguration(new ExportDatasetConfiguration().withColumns(Arrays.asList("bjj", "anvx")));
        model = BinaryData.fromObject(model).toObject(ExportDataset.class);
        Assertions.assertEquals(GranularityType.DAILY, model.granularity());
        Assertions.assertEquals("bjj", model.configuration().columns().get(0));
    }
}
