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

package com.azure.resourcemanager.dynatrace.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.dynatrace.models.PlanData;
import java.time.OffsetDateTime;
import org.junit.jupiter.api.Assertions;

public final class PlanDataTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PlanData model =
            BinaryData
                .fromString(
                    "{\"usageType\":\"vnipjox\",\"billingCycle\":\"nchgej\",\"planDetails\":\"odmailzyd\",\"effectiveDate\":\"2021-10-17T17:25:15Z\"}")
                .toObject(PlanData.class);
        Assertions.assertEquals("vnipjox", model.usageType());
        Assertions.assertEquals("nchgej", model.billingCycle());
        Assertions.assertEquals("odmailzyd", model.planDetails());
        Assertions.assertEquals(OffsetDateTime.parse("2021-10-17T17:25:15Z"), model.effectiveDate());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PlanData model =
            new PlanData()
                .withUsageType("vnipjox")
                .withBillingCycle("nchgej")
                .withPlanDetails("odmailzyd")
                .withEffectiveDate(OffsetDateTime.parse("2021-10-17T17:25:15Z"));
        model = BinaryData.fromObject(model).toObject(PlanData.class);
        Assertions.assertEquals("vnipjox", model.usageType());
        Assertions.assertEquals("nchgej", model.billingCycle());
        Assertions.assertEquals("odmailzyd", model.planDetails());
        Assertions.assertEquals(OffsetDateTime.parse("2021-10-17T17:25:15Z"), model.effectiveDate());
    }
}
