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

package com.azure.resourcemanager.cognitiveservices.generated;

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

public final class DomainAvailabilityInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DomainAvailabilityInner model =
            BinaryData
                .fromString(
                    "{\"isSubdomainAvailable\":false,\"reason\":\"fauvjfdxx\",\"subdomainName\":\"e\",\"type\":\"t\",\"kind\":\"aqtdoqmcbx\"}")
                .toObject(DomainAvailabilityInner.class);
        Assertions.assertEquals(false, model.isSubdomainAvailable());
        Assertions.assertEquals("fauvjfdxx", model.reason());
        Assertions.assertEquals("e", model.subdomainName());
        Assertions.assertEquals("t", model.type());
        Assertions.assertEquals("aqtdoqmcbx", model.kind());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DomainAvailabilityInner model =
            new DomainAvailabilityInner()
                .withIsSubdomainAvailable(false)
                .withReason("fauvjfdxx")
                .withSubdomainName("e")
                .withType("t")
                .withKind("aqtdoqmcbx");
        model = BinaryData.fromObject(model).toObject(DomainAvailabilityInner.class);
        Assertions.assertEquals(false, model.isSubdomainAvailable());
        Assertions.assertEquals("fauvjfdxx", model.reason());
        Assertions.assertEquals("e", model.subdomainName());
        Assertions.assertEquals("t", model.type());
        Assertions.assertEquals("aqtdoqmcbx", model.kind());
    }
}
