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

package com.azure.resourcemanager.appconfiguration.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.appconfiguration.models.CheckNameAvailabilityParameters;
import com.azure.resourcemanager.appconfiguration.models.ConfigurationResourceType;
import org.junit.jupiter.api.Assertions;

public final class CheckNameAvailabilityParametersTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CheckNameAvailabilityParameters model =
            BinaryData
                .fromString("{\"name\":\"hmuouqfprwzwbn\",\"type\":\"Microsoft.AppConfiguration/configurationStores\"}")
                .toObject(CheckNameAvailabilityParameters.class);
        Assertions.assertEquals("hmuouqfprwzwbn", model.name());
        Assertions
            .assertEquals(ConfigurationResourceType.MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES, model.type());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CheckNameAvailabilityParameters model =
            new CheckNameAvailabilityParameters()
                .withName("hmuouqfprwzwbn")
                .withType(ConfigurationResourceType.MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES);
        model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityParameters.class);
        Assertions.assertEquals("hmuouqfprwzwbn", model.name());
        Assertions
            .assertEquals(ConfigurationResourceType.MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES, model.type());
    }
}
