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

package com.azure.resourcemanager.powerbidedicated.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.powerbidedicated.fluent.models.DedicatedCapacityMutableProperties;
import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacityAdministrators;
import com.azure.resourcemanager.powerbidedicated.models.Mode;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class DedicatedCapacityMutablePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DedicatedCapacityMutableProperties model =
            BinaryData
                .fromString(
                    "{\"administration\":{\"members\":[\"ryuanzwuxzdxtay\",\"lhmwhfpmrqobm\"]},\"mode\":\"Gen2\",\"tenantId\":\"nryrtihf\",\"friendlyName\":\"ijbpzvgnwzsymgl\"}")
                .toObject(DedicatedCapacityMutableProperties.class);
        Assertions.assertEquals("ryuanzwuxzdxtay", model.administration().members().get(0));
        Assertions.assertEquals(Mode.GEN2, model.mode());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DedicatedCapacityMutableProperties model =
            new DedicatedCapacityMutableProperties()
                .withAdministration(
                    new DedicatedCapacityAdministrators()
                        .withMembers(Arrays.asList("ryuanzwuxzdxtay", "lhmwhfpmrqobm")))
                .withMode(Mode.GEN2);
        model = BinaryData.fromObject(model).toObject(DedicatedCapacityMutableProperties.class);
        Assertions.assertEquals("ryuanzwuxzdxtay", model.administration().members().get(0));
        Assertions.assertEquals(Mode.GEN2, model.mode());
    }
}
