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

package com.azure.resourcemanager.machinelearning.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.machinelearning.models.QuotaBaseProperties;
import com.azure.resourcemanager.machinelearning.models.QuotaUnit;
import org.junit.jupiter.api.Assertions;

public final class QuotaBasePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        QuotaBaseProperties model =
            BinaryData
                .fromString(
                    "{\"id\":\"ozmyzydagfu\",\"type\":\"bezy\",\"limit\":1156651479695546396,\"unit\":\"Count\"}")
                .toObject(QuotaBaseProperties.class);
        Assertions.assertEquals("ozmyzydagfu", model.id());
        Assertions.assertEquals("bezy", model.type());
        Assertions.assertEquals(1156651479695546396L, model.limit());
        Assertions.assertEquals(QuotaUnit.COUNT, model.unit());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        QuotaBaseProperties model =
            new QuotaBaseProperties()
                .withId("ozmyzydagfu")
                .withType("bezy")
                .withLimit(1156651479695546396L)
                .withUnit(QuotaUnit.COUNT);
        model = BinaryData.fromObject(model).toObject(QuotaBaseProperties.class);
        Assertions.assertEquals("ozmyzydagfu", model.id());
        Assertions.assertEquals("bezy", model.type());
        Assertions.assertEquals(1156651479695546396L, model.limit());
        Assertions.assertEquals(QuotaUnit.COUNT, model.unit());
    }
}
