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

package com.azure.resourcemanager.machinelearning.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.machinelearning.models.EstimatedVMPrice;
import com.azure.resourcemanager.machinelearning.models.VMPriceOSType;
import com.azure.resourcemanager.machinelearning.models.VMTier;
import org.junit.jupiter.api.Assertions;

public final class EstimatedVMPriceTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        EstimatedVMPrice model =
            BinaryData
                .fromString("{\"retailPrice\":57.931778810567735,\"osType\":\"Linux\",\"vmTier\":\"LowPriority\"}")
                .toObject(EstimatedVMPrice.class);
        Assertions.assertEquals(57.931778810567735, model.retailPrice());
        Assertions.assertEquals(VMPriceOSType.LINUX, model.osType());
        Assertions.assertEquals(VMTier.LOW_PRIORITY, model.vmTier());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        EstimatedVMPrice model =
            new EstimatedVMPrice()
                .withRetailPrice(57.931778810567735)
                .withOsType(VMPriceOSType.LINUX)
                .withVmTier(VMTier.LOW_PRIORITY);
        model = BinaryData.fromObject(model).toObject(EstimatedVMPrice.class);
        Assertions.assertEquals(57.931778810567735, model.retailPrice());
        Assertions.assertEquals(VMPriceOSType.LINUX, model.osType());
        Assertions.assertEquals(VMTier.LOW_PRIORITY, model.vmTier());
    }
}
