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

package com.azure.resourcemanager.reservations.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.reservations.models.ReservationUtilizationAggregates;
import com.azure.resourcemanager.reservations.models.ReservationsPropertiesUtilization;
import java.util.Arrays;

public final class ReservationsPropertiesUtilizationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ReservationsPropertiesUtilization model =
            BinaryData
                .fromString(
                    "{\"trend\":\"hmenevfyexfwhybc\",\"aggregates\":[{\"grain\":53.581215,\"grainUnit\":\"c\",\"value\":88.85056,\"valueUnit\":\"nnaamdectehfiqsc\"},{\"grain\":55.374454,\"grainUnit\":\"vhezrkgqhcj\",\"value\":92.9146,\"valueUnit\":\"vgmkqsleyyvxyqjp\"}]}")
                .toObject(ReservationsPropertiesUtilization.class);
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ReservationsPropertiesUtilization model =
            new ReservationsPropertiesUtilization()
                .withAggregates(
                    Arrays.asList(new ReservationUtilizationAggregates(), new ReservationUtilizationAggregates()));
        model = BinaryData.fromObject(model).toObject(ReservationsPropertiesUtilization.class);
    }
}
