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

package com.azure.resourcemanager.signalr.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.signalr.models.ResourceLogCategory;
import com.azure.resourcemanager.signalr.models.ResourceLogConfiguration;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ResourceLogConfigurationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ResourceLogConfiguration model =
            BinaryData
                .fromString(
                    "{\"categories\":[{\"name\":\"gibtnm\",\"enabled\":\"ebwwaloayqc\"},{\"name\":\"rtzju\",\"enabled\":\"wyzmhtxon\"},{\"name\":\"ts\",\"enabled\":\"jcbpwxqpsrknft\"},{\"name\":\"vriuhprwmdyvx\",\"enabled\":\"ayriwwroyqbexrm\"}]}")
                .toObject(ResourceLogConfiguration.class);
        Assertions.assertEquals("gibtnm", model.categories().get(0).name());
        Assertions.assertEquals("ebwwaloayqc", model.categories().get(0).enabled());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ResourceLogConfiguration model =
            new ResourceLogConfiguration()
                .withCategories(
                    Arrays
                        .asList(
                            new ResourceLogCategory().withName("gibtnm").withEnabled("ebwwaloayqc"),
                            new ResourceLogCategory().withName("rtzju").withEnabled("wyzmhtxon"),
                            new ResourceLogCategory().withName("ts").withEnabled("jcbpwxqpsrknft"),
                            new ResourceLogCategory().withName("vriuhprwmdyvx").withEnabled("ayriwwroyqbexrm")));
        model = BinaryData.fromObject(model).toObject(ResourceLogConfiguration.class);
        Assertions.assertEquals("gibtnm", model.categories().get(0).name());
        Assertions.assertEquals("ebwwaloayqc", model.categories().get(0).enabled());
    }
}
