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

package com.azure.resourcemanager.costmanagement.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.costmanagement.models.KpiProperties;
import com.azure.resourcemanager.costmanagement.models.KpiType;
import org.junit.jupiter.api.Assertions;

public final class KpiPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        KpiProperties model =
            BinaryData
                .fromString("{\"type\":\"Forecast\",\"id\":\"w\",\"enabled\":false}")
                .toObject(KpiProperties.class);
        Assertions.assertEquals(KpiType.FORECAST, model.type());
        Assertions.assertEquals("w", model.id());
        Assertions.assertEquals(false, model.enabled());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        KpiProperties model = new KpiProperties().withType(KpiType.FORECAST).withId("w").withEnabled(false);
        model = BinaryData.fromObject(model).toObject(KpiProperties.class);
        Assertions.assertEquals(KpiType.FORECAST, model.type());
        Assertions.assertEquals("w", model.id());
        Assertions.assertEquals(false, model.enabled());
    }
}
