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

package com.azure.resourcemanager.maintenance.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.maintenance.fluent.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(
                    "{\"startDateTime\":\"kanyktzlcuiywg\",\"expirationDateTime\":\"wgndrvynhzgpp\",\"duration\":\"cgyncocpecf\",\"timeZone\":\"mcoo\",\"recurEvery\":\"xlzevgbmqjqabcy\"}")
                .toObject(MaintenanceWindow.class);
        Assertions.assertEquals("kanyktzlcuiywg", model.startDateTime());
        Assertions.assertEquals("wgndrvynhzgpp", model.expirationDateTime());
        Assertions.assertEquals("cgyncocpecf", model.duration());
        Assertions.assertEquals("mcoo", model.timeZone());
        Assertions.assertEquals("xlzevgbmqjqabcy", model.recurEvery());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MaintenanceWindow model =
            new MaintenanceWindow()
                .withStartDateTime("kanyktzlcuiywg")
                .withExpirationDateTime("wgndrvynhzgpp")
                .withDuration("cgyncocpecf")
                .withTimeZone("mcoo")
                .withRecurEvery("xlzevgbmqjqabcy");
        model = BinaryData.fromObject(model).toObject(MaintenanceWindow.class);
        Assertions.assertEquals("kanyktzlcuiywg", model.startDateTime());
        Assertions.assertEquals("wgndrvynhzgpp", model.expirationDateTime());
        Assertions.assertEquals("cgyncocpecf", model.duration());
        Assertions.assertEquals("mcoo", model.timeZone());
        Assertions.assertEquals("xlzevgbmqjqabcy", model.recurEvery());
    }
}
