// 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;

public final class UsageTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        Usage model =
            BinaryData
                .fromString(
                    "{\"unit\":\"mciodhkhazxkhn\",\"currentValue\":1031605542268068469,\"limit\":5106824512288532592,\"name\":{\"value\":\"egokdwbwhkszzcmr\",\"localizedValue\":\"xztvbtqgsfraoyzk\"}}")
                .toObject(Usage.class);
        Assertions.assertEquals("mciodhkhazxkhn", model.unit());
        Assertions.assertEquals(1031605542268068469L, model.currentValue());
        Assertions.assertEquals(5106824512288532592L, model.limit());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        Usage model =
            new Usage()
                .withUnit("mciodhkhazxkhn")
                .withCurrentValue(1031605542268068469L)
                .withLimit(5106824512288532592L);
        model = BinaryData.fromObject(model).toObject(Usage.class);
        Assertions.assertEquals("mciodhkhazxkhn", model.unit());
        Assertions.assertEquals(1031605542268068469L, model.currentValue());
        Assertions.assertEquals(5106824512288532592L, model.limit());
    }
}
