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

package com.azure.resourcemanager.netapp.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.netapp.fluent.models.CheckAvailabilityResponseInner;
import com.azure.resourcemanager.netapp.models.InAvailabilityReasonType;
import org.junit.jupiter.api.Assertions;

public final class CheckAvailabilityResponseInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CheckAvailabilityResponseInner model =
            BinaryData
                .fromString("{\"isAvailable\":true,\"reason\":\"Invalid\",\"message\":\"qidtqajzyu\"}")
                .toObject(CheckAvailabilityResponseInner.class);
        Assertions.assertEquals(true, model.isAvailable());
        Assertions.assertEquals(InAvailabilityReasonType.INVALID, model.reason());
        Assertions.assertEquals("qidtqajzyu", model.message());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CheckAvailabilityResponseInner model =
            new CheckAvailabilityResponseInner()
                .withIsAvailable(true)
                .withReason(InAvailabilityReasonType.INVALID)
                .withMessage("qidtqajzyu");
        model = BinaryData.fromObject(model).toObject(CheckAvailabilityResponseInner.class);
        Assertions.assertEquals(true, model.isAvailable());
        Assertions.assertEquals(InAvailabilityReasonType.INVALID, model.reason());
        Assertions.assertEquals("qidtqajzyu", model.message());
    }
}
