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

package com.azure.resourcemanager.frontdoor.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.frontdoor.models.CheckNameAvailabilityInput;
import com.azure.resourcemanager.frontdoor.models.ResourceType;
import org.junit.jupiter.api.Assertions;

public final class CheckNameAvailabilityInputTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CheckNameAvailabilityInput model =
            BinaryData
                .fromString("{\"name\":\"odgmaajrmvdjwz\",\"type\":\"Microsoft.Network/frontDoors/frontendEndpoints\"}")
                .toObject(CheckNameAvailabilityInput.class);
        Assertions.assertEquals("odgmaajrmvdjwz", model.name());
        Assertions.assertEquals(ResourceType.MICROSOFT_NETWORK_FRONT_DOORS_FRONTEND_ENDPOINTS, model.type());
    }

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