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

package com.azure.resourcemanager.cosmosdbforpostgresql.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.cosmosdbforpostgresql.fluent.models.NameAvailabilityInner;
import org.junit.jupiter.api.Assertions;

public final class NameAvailabilityInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        NameAvailabilityInner model =
            BinaryData
                .fromString(
                    "{\"message\":\"oo\",\"nameAvailable\":true,\"name\":\"zevgb\",\"type\":\"jqabcypmivkwlzuv\"}")
                .toObject(NameAvailabilityInner.class);
        Assertions.assertEquals("oo", model.message());
        Assertions.assertEquals(true, model.nameAvailable());
        Assertions.assertEquals("zevgb", model.name());
        Assertions.assertEquals("jqabcypmivkwlzuv", model.type());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        NameAvailabilityInner model =
            new NameAvailabilityInner()
                .withMessage("oo")
                .withNameAvailable(true)
                .withName("zevgb")
                .withType("jqabcypmivkwlzuv");
        model = BinaryData.fromObject(model).toObject(NameAvailabilityInner.class);
        Assertions.assertEquals("oo", model.message());
        Assertions.assertEquals(true, model.nameAvailable());
        Assertions.assertEquals("zevgb", model.name());
        Assertions.assertEquals("jqabcypmivkwlzuv", model.type());
    }
}
