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

package com.azure.resourcemanager.synapse.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.synapse.fluent.models.LanguageExtensionInner;
import com.azure.resourcemanager.synapse.models.LanguageExtensionName;
import com.azure.resourcemanager.synapse.models.LanguageExtensionsList;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class LanguageExtensionsListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        LanguageExtensionsList model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"languageExtensionName\":\"PYTHON\"},{\"languageExtensionName\":\"R\"},{\"languageExtensionName\":\"PYTHON\"},{\"languageExtensionName\":\"R\"}]}")
                .toObject(LanguageExtensionsList.class);
        Assertions.assertEquals(LanguageExtensionName.PYTHON, model.value().get(0).languageExtensionName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        LanguageExtensionsList model =
            new LanguageExtensionsList()
                .withValue(
                    Arrays
                        .asList(
                            new LanguageExtensionInner().withLanguageExtensionName(LanguageExtensionName.PYTHON),
                            new LanguageExtensionInner().withLanguageExtensionName(LanguageExtensionName.R),
                            new LanguageExtensionInner().withLanguageExtensionName(LanguageExtensionName.PYTHON),
                            new LanguageExtensionInner().withLanguageExtensionName(LanguageExtensionName.R)));
        model = BinaryData.fromObject(model).toObject(LanguageExtensionsList.class);
        Assertions.assertEquals(LanguageExtensionName.PYTHON, model.value().get(0).languageExtensionName());
    }
}
