// 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.ScheduleBase;
import com.azure.resourcemanager.machinelearning.models.ScheduleProvisioningState;
import com.azure.resourcemanager.machinelearning.models.ScheduleStatus;
import org.junit.jupiter.api.Assertions;

public final class ScheduleBaseTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ScheduleBase model =
            BinaryData
                .fromString("{\"id\":\"piudeugfsxzecpa\",\"provisioningStatus\":\"Completed\",\"status\":\"Disabled\"}")
                .toObject(ScheduleBase.class);
        Assertions.assertEquals("piudeugfsxzecpa", model.id());
        Assertions.assertEquals(ScheduleProvisioningState.COMPLETED, model.provisioningStatus());
        Assertions.assertEquals(ScheduleStatus.DISABLED, model.status());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ScheduleBase model =
            new ScheduleBase()
                .withId("piudeugfsxzecpa")
                .withProvisioningStatus(ScheduleProvisioningState.COMPLETED)
                .withStatus(ScheduleStatus.DISABLED);
        model = BinaryData.fromObject(model).toObject(ScheduleBase.class);
        Assertions.assertEquals("piudeugfsxzecpa", model.id());
        Assertions.assertEquals(ScheduleProvisioningState.COMPLETED, model.provisioningStatus());
        Assertions.assertEquals(ScheduleStatus.DISABLED, model.status());
    }
}
