// 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.models.CommitmentQuota;
import org.junit.jupiter.api.Assertions;

public final class CommitmentQuotaTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CommitmentQuota model =
            BinaryData
                .fromString("{\"quantity\":4786890397912480430,\"unit\":\"ctobg\"}")
                .toObject(CommitmentQuota.class);
        Assertions.assertEquals(4786890397912480430L, model.quantity());
        Assertions.assertEquals("ctobg", model.unit());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CommitmentQuota model = new CommitmentQuota().withQuantity(4786890397912480430L).withUnit("ctobg");
        model = BinaryData.fromObject(model).toObject(CommitmentQuota.class);
        Assertions.assertEquals(4786890397912480430L, model.quantity());
        Assertions.assertEquals("ctobg", model.unit());
    }
}
