// 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.DedicatedCapacityProperties;
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 DedicatedCapacityPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DedicatedCapacityProperties model =
            BinaryData
                .fromString(
                    "{\"state\":\"Suspending\",\"provisioningState\":\"Updating\",\"administration\":{\"members\":[\"smy\"]},\"mode\":\"Gen2\",\"tenantId\":\"tmlxhekuksjtx\",\"friendlyName\":\"cdm\"}")
                .toObject(DedicatedCapacityProperties.class);
        Assertions.assertEquals("smy", model.administration().members().get(0));
        Assertions.assertEquals(Mode.GEN2, model.mode());
    }

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