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

package com.azure.resourcemanager.appcontainers.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.appcontainers.models.BillingMeter;
import com.azure.resourcemanager.appcontainers.models.BillingMeterProperties;
import org.junit.jupiter.api.Assertions;

public final class BillingMeterTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        BillingMeter model =
            BinaryData
                .fromString(
                    "{\"location\":\"suesnzw\",\"properties\":{\"category\":\"bavo\",\"meterType\":\"zdmohctbqvu\",\"displayName\":\"xdn\"},\"id\":\"vo\",\"name\":\"gujjugwdkcglh\",\"type\":\"lazjdyggdtjixhbk\"}")
                .toObject(BillingMeter.class);
        Assertions.assertEquals("suesnzw", model.location());
        Assertions.assertEquals("bavo", model.properties().category());
        Assertions.assertEquals("zdmohctbqvu", model.properties().meterType());
        Assertions.assertEquals("xdn", model.properties().displayName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        BillingMeter model =
            new BillingMeter()
                .withLocation("suesnzw")
                .withProperties(
                    new BillingMeterProperties()
                        .withCategory("bavo")
                        .withMeterType("zdmohctbqvu")
                        .withDisplayName("xdn"));
        model = BinaryData.fromObject(model).toObject(BillingMeter.class);
        Assertions.assertEquals("suesnzw", model.location());
        Assertions.assertEquals("bavo", model.properties().category());
        Assertions.assertEquals("zdmohctbqvu", model.properties().meterType());
        Assertions.assertEquals("xdn", model.properties().displayName());
    }
}
