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

package com.azure.resourcemanager.devcenter.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.devcenter.fluent.models.ScheduleInner;
import com.azure.resourcemanager.devcenter.models.ScheduleEnableStatus;
import com.azure.resourcemanager.devcenter.models.ScheduledFrequency;
import com.azure.resourcemanager.devcenter.models.ScheduledType;
import org.junit.jupiter.api.Assertions;

public final class ScheduleInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ScheduleInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"provisioningState\":\"Updating\",\"type\":\"StopDevBox\",\"frequency\":\"Daily\",\"time\":\"vaytdwkqbrq\",\"timeZone\":\"paxh\",\"state\":\"Disabled\"},\"id\":\"livpdt\",\"name\":\"irqtdqoa\",\"type\":\"oruzfgsquyfxrxx\"}")
                .toObject(ScheduleInner.class);
        Assertions.assertEquals(ScheduledType.STOP_DEV_BOX, model.typePropertiesType());
        Assertions.assertEquals(ScheduledFrequency.DAILY, model.frequency());
        Assertions.assertEquals("vaytdwkqbrq", model.time());
        Assertions.assertEquals("paxh", model.timeZone());
        Assertions.assertEquals(ScheduleEnableStatus.DISABLED, model.state());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ScheduleInner model =
            new ScheduleInner()
                .withTypePropertiesType(ScheduledType.STOP_DEV_BOX)
                .withFrequency(ScheduledFrequency.DAILY)
                .withTime("vaytdwkqbrq")
                .withTimeZone("paxh")
                .withState(ScheduleEnableStatus.DISABLED);
        model = BinaryData.fromObject(model).toObject(ScheduleInner.class);
        Assertions.assertEquals(ScheduledType.STOP_DEV_BOX, model.typePropertiesType());
        Assertions.assertEquals(ScheduledFrequency.DAILY, model.frequency());
        Assertions.assertEquals("vaytdwkqbrq", model.time());
        Assertions.assertEquals("paxh", model.timeZone());
        Assertions.assertEquals(ScheduleEnableStatus.DISABLED, model.state());
    }
}
