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

package com.azure.resourcemanager.synapse.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.synapse.models.DatabaseCheckNameRequest;
import com.azure.resourcemanager.synapse.models.Type;
import org.junit.jupiter.api.Assertions;

public final class DatabaseCheckNameRequestTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DatabaseCheckNameRequest model =
            BinaryData
                .fromString("{\"name\":\"xiidloped\",\"type\":\"Microsoft.Synapse/workspaces/kustoPools/databases\"}")
                .toObject(DatabaseCheckNameRequest.class);
        Assertions.assertEquals("xiidloped", model.name());
        Assertions.assertEquals(Type.MICROSOFT_SYNAPSE_WORKSPACES_KUSTO_POOLS_DATABASES, model.type());
    }

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