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

package com.azure.resourcemanager.quota.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.quota.models.LimitJsonObject;
import com.azure.resourcemanager.quota.models.QuotaProperties;
import com.azure.resourcemanager.quota.models.ResourceName;
import org.junit.jupiter.api.Assertions;

public final class QuotaPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        QuotaProperties model =
            BinaryData
                .fromString(
                    "{\"limit\":{\"limitObjectType\":\"LimitJsonObject\"},\"unit\":\"udccsnhsjc\",\"name\":{\"value\":\"j\",\"localizedValue\":\"ryhtnapczwlokjy\"},\"resourceType\":\"kkvnipjox\",\"quotaPeriod\":\"nchgej\",\"isQuotaApplicable\":true,\"properties\":\"datamailzydehojw\"}")
                .toObject(QuotaProperties.class);
        Assertions.assertEquals("j", model.name().value());
        Assertions.assertEquals("kkvnipjox", model.resourceType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        QuotaProperties model =
            new QuotaProperties()
                .withLimit(new LimitJsonObject())
                .withName(new ResourceName().withValue("j"))
                .withResourceType("kkvnipjox")
                .withProperties("datamailzydehojw");
        model = BinaryData.fromObject(model).toObject(QuotaProperties.class);
        Assertions.assertEquals("j", model.name().value());
        Assertions.assertEquals("kkvnipjox", model.resourceType());
    }
}
