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

package com.azure.resourcemanager.postgresqlflexibleserver.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.postgresqlflexibleserver.models.MaintenanceWindow;
import org.junit.jupiter.api.Assertions;

public final class MaintenanceWindowTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MaintenanceWindow model =
            BinaryData
                .fromString(
                    "{\"customWindow\":\"uknvudwti\",\"startHour\":133898645,\"startMinute\":580602799,\"dayOfWeek\":1236477167}")
                .toObject(MaintenanceWindow.class);
        Assertions.assertEquals("uknvudwti", model.customWindow());
        Assertions.assertEquals(133898645, model.startHour());
        Assertions.assertEquals(580602799, model.startMinute());
        Assertions.assertEquals(1236477167, model.dayOfWeek());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MaintenanceWindow model =
            new MaintenanceWindow()
                .withCustomWindow("uknvudwti")
                .withStartHour(133898645)
                .withStartMinute(580602799)
                .withDayOfWeek(1236477167);
        model = BinaryData.fromObject(model).toObject(MaintenanceWindow.class);
        Assertions.assertEquals("uknvudwti", model.customWindow());
        Assertions.assertEquals(133898645, model.startHour());
        Assertions.assertEquals(580602799, model.startMinute());
        Assertions.assertEquals(1236477167, model.dayOfWeek());
    }
}
