// 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.CheckNameRequest;
import com.azure.resourcemanager.kusto.models.Type;
import org.junit.jupiter.api.Assertions;

public final class CheckNameRequestTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CheckNameRequest model =
            BinaryData
                .fromString(
                    "{\"name\":\"twwrqp\",\"type\":\"Microsoft.Kusto/clusters/attachedDatabaseConfigurations\"}")
                .toObject(CheckNameRequest.class);
        Assertions.assertEquals("twwrqp", model.name());
        Assertions.assertEquals(Type.MICROSOFT_KUSTO_CLUSTERS_ATTACHED_DATABASE_CONFIGURATIONS, model.type());
    }

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