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

public final class SavingsPlanUtilizationSummaryPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SavingsPlanUtilizationSummaryProperties model =
            BinaryData
                .fromString(
                    "{\"armSkuName\":\"xoftpipiwyczu\",\"benefitId\":\"a\",\"benefitOrderId\":\"qjlihhyuspska\",\"benefitType\":\"SavingsPlan\",\"usageDate\":\"2021-12-09T00:48:19Z\"}")
                .toObject(SavingsPlanUtilizationSummaryProperties.class);
        Assertions.assertEquals(BenefitKind.SAVINGS_PLAN, model.benefitType());
    }

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