// 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.BenefitKind;
import com.azure.resourcemanager.costmanagement.models.SavingsPlanUtilizationSummary;
import org.junit.jupiter.api.Assertions;

public final class SavingsPlanUtilizationSummaryTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SavingsPlanUtilizationSummary model =
            BinaryData
                .fromString(
                    "{\"kind\":\"SavingsPlan\",\"properties\":{\"armSkuName\":\"dcqvpn\",\"benefitId\":\"ujviylwdshfs\",\"benefitOrderId\":\"rbgyefry\",\"benefitType\":\"IncludedQuantity\",\"usageDate\":\"2020-12-23T00:32:06Z\"},\"id\":\"j\",\"name\":\"mwn\",\"type\":\"otmrfhir\"}")
                .toObject(SavingsPlanUtilizationSummary.class);
        Assertions.assertEquals(BenefitKind.INCLUDED_QUANTITY, model.benefitType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SavingsPlanUtilizationSummary model =
            new SavingsPlanUtilizationSummary().withBenefitType(BenefitKind.INCLUDED_QUANTITY);
        model = BinaryData.fromObject(model).toObject(SavingsPlanUtilizationSummary.class);
        Assertions.assertEquals(BenefitKind.INCLUDED_QUANTITY, model.benefitType());
    }
}
