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

package com.azure.resourcemanager.hdinsight.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hdinsight.models.Usage;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class UsageTests {
    @Test
    public void testDeserialize() {
        Usage model =
            BinaryData
                .fromString(
                    "{\"unit\":\"uvarmywdmjsjq\",\"currentValue\":7543119596845628167,\"limit\":1070182178135164646,\"name\":{\"value\":\"lyc\",\"localizedValue\":\"uhpkxkgymar\"}}")
                .toObject(Usage.class);
        Assertions.assertEquals("uvarmywdmjsjq", model.unit());
        Assertions.assertEquals(7543119596845628167L, model.currentValue());
        Assertions.assertEquals(1070182178135164646L, model.limit());
    }

    @Test
    public void testSerialize() {
        Usage model =
            new Usage()
                .withUnit("uvarmywdmjsjq")
                .withCurrentValue(7543119596845628167L)
                .withLimit(1070182178135164646L);
        model = BinaryData.fromObject(model).toObject(Usage.class);
        Assertions.assertEquals("uvarmywdmjsjq", model.unit());
        Assertions.assertEquals(7543119596845628167L, model.currentValue());
        Assertions.assertEquals(1070182178135164646L, model.limit());
    }
}
