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

package com.azure.resourcemanager.kusto.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.kusto.models.TableLevelSharingProperties;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class TableLevelSharingPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        TableLevelSharingProperties model =
            BinaryData
                .fromString(
                    "{\"tablesToInclude\":[\"gnzscxaqwo\",\"chcbonqvpkvlrxnj\",\"ase\",\"pheoflokeyy\"],\"tablesToExclude\":[\"jbdlwtgrhpdjpju\"],\"externalTablesToInclude\":[\"xazjpqyegual\",\"b\"],\"externalTablesToExclude\":[\"e\",\"jzzvdud\"],\"materializedViewsToInclude\":[\"slfhotwm\",\"ynpwlbj\",\"pgacftadehxnlty\"],\"materializedViewsToExclude\":[\"ppusuesnzwdejba\",\"orxzdmohctbqvud\",\"xdn\"],\"functionsToInclude\":[\"owgujjugwdkcglhs\"],\"functionsToExclude\":[\"jdyggdtji\"]}")
                .toObject(TableLevelSharingProperties.class);
        Assertions.assertEquals("gnzscxaqwo", model.tablesToInclude().get(0));
        Assertions.assertEquals("jbdlwtgrhpdjpju", model.tablesToExclude().get(0));
        Assertions.assertEquals("xazjpqyegual", model.externalTablesToInclude().get(0));
        Assertions.assertEquals("e", model.externalTablesToExclude().get(0));
        Assertions.assertEquals("slfhotwm", model.materializedViewsToInclude().get(0));
        Assertions.assertEquals("ppusuesnzwdejba", model.materializedViewsToExclude().get(0));
        Assertions.assertEquals("owgujjugwdkcglhs", model.functionsToInclude().get(0));
        Assertions.assertEquals("jdyggdtji", model.functionsToExclude().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        TableLevelSharingProperties model =
            new TableLevelSharingProperties()
                .withTablesToInclude(Arrays.asList("gnzscxaqwo", "chcbonqvpkvlrxnj", "ase", "pheoflokeyy"))
                .withTablesToExclude(Arrays.asList("jbdlwtgrhpdjpju"))
                .withExternalTablesToInclude(Arrays.asList("xazjpqyegual", "b"))
                .withExternalTablesToExclude(Arrays.asList("e", "jzzvdud"))
                .withMaterializedViewsToInclude(Arrays.asList("slfhotwm", "ynpwlbj", "pgacftadehxnlty"))
                .withMaterializedViewsToExclude(Arrays.asList("ppusuesnzwdejba", "orxzdmohctbqvud", "xdn"))
                .withFunctionsToInclude(Arrays.asList("owgujjugwdkcglhs"))
                .withFunctionsToExclude(Arrays.asList("jdyggdtji"));
        model = BinaryData.fromObject(model).toObject(TableLevelSharingProperties.class);
        Assertions.assertEquals("gnzscxaqwo", model.tablesToInclude().get(0));
        Assertions.assertEquals("jbdlwtgrhpdjpju", model.tablesToExclude().get(0));
        Assertions.assertEquals("xazjpqyegual", model.externalTablesToInclude().get(0));
        Assertions.assertEquals("e", model.externalTablesToExclude().get(0));
        Assertions.assertEquals("slfhotwm", model.materializedViewsToInclude().get(0));
        Assertions.assertEquals("ppusuesnzwdejba", model.materializedViewsToExclude().get(0));
        Assertions.assertEquals("owgujjugwdkcglhs", model.functionsToInclude().get(0));
        Assertions.assertEquals("jdyggdtji", model.functionsToExclude().get(0));
    }
}
