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

public final class FileDestinationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        FileDestination model =
            BinaryData.fromString("{\"fileFormats\":[\"Csv\",\"Csv\",\"Csv\"]}").toObject(FileDestination.class);
        Assertions.assertEquals(FileFormat.CSV, model.fileFormats().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        FileDestination model =
            new FileDestination().withFileFormats(Arrays.asList(FileFormat.CSV, FileFormat.CSV, FileFormat.CSV));
        model = BinaryData.fromObject(model).toObject(FileDestination.class);
        Assertions.assertEquals(FileFormat.CSV, model.fileFormats().get(0));
    }
}
