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

package com.azure.resourcemanager.reservations.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.reservations.models.InstanceFlexibility;
import com.azure.resourcemanager.reservations.models.PurchaseRequestPropertiesReservedResourceProperties;
import org.junit.jupiter.api.Assertions;

public final class PurchaseRequestPropertiesReservedResourcePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PurchaseRequestPropertiesReservedResourceProperties model =
            BinaryData
                .fromString("{\"instanceFlexibility\":\"Off\"}")
                .toObject(PurchaseRequestPropertiesReservedResourceProperties.class);
        Assertions.assertEquals(InstanceFlexibility.OFF, model.instanceFlexibility());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PurchaseRequestPropertiesReservedResourceProperties model =
            new PurchaseRequestPropertiesReservedResourceProperties().withInstanceFlexibility(InstanceFlexibility.OFF);
        model = BinaryData.fromObject(model).toObject(PurchaseRequestPropertiesReservedResourceProperties.class);
        Assertions.assertEquals(InstanceFlexibility.OFF, model.instanceFlexibility());
    }
}
