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

package com.azure.resourcemanager.desktopvirtualization.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek;
import com.azure.resourcemanager.desktopvirtualization.models.MaintenanceWindowProperties;
import org.junit.jupiter.api.Assertions;

public final class MaintenanceWindowPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MaintenanceWindowProperties model =
            BinaryData
                .fromString("{\"hour\":1591764317,\"dayOfWeek\":\"Sunday\"}")
                .toObject(MaintenanceWindowProperties.class);
        Assertions.assertEquals(1591764317, model.hour());
        Assertions.assertEquals(DayOfWeek.SUNDAY, model.dayOfWeek());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MaintenanceWindowProperties model =
            new MaintenanceWindowProperties().withHour(1591764317).withDayOfWeek(DayOfWeek.SUNDAY);
        model = BinaryData.fromObject(model).toObject(MaintenanceWindowProperties.class);
        Assertions.assertEquals(1591764317, model.hour());
        Assertions.assertEquals(DayOfWeek.SUNDAY, model.dayOfWeek());
    }
}
