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

package com.azure.resourcemanager.mariadb.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.mariadb.models.WaitStatisticsInput;
import java.time.OffsetDateTime;
import org.junit.jupiter.api.Assertions;

public final class WaitStatisticsInputTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        WaitStatisticsInput model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"observationStartTime\":\"2021-07-28T14:37:17Z\",\"observationEndTime\":\"2021-05-07T17:14:51Z\",\"aggregationWindow\":\"bmehh\"}}")
                .toObject(WaitStatisticsInput.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-07-28T14:37:17Z"), model.observationStartTime());
        Assertions.assertEquals(OffsetDateTime.parse("2021-05-07T17:14:51Z"), model.observationEndTime());
        Assertions.assertEquals("bmehh", model.aggregationWindow());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        WaitStatisticsInput model =
            new WaitStatisticsInput()
                .withObservationStartTime(OffsetDateTime.parse("2021-07-28T14:37:17Z"))
                .withObservationEndTime(OffsetDateTime.parse("2021-05-07T17:14:51Z"))
                .withAggregationWindow("bmehh");
        model = BinaryData.fromObject(model).toObject(WaitStatisticsInput.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-07-28T14:37:17Z"), model.observationStartTime());
        Assertions.assertEquals(OffsetDateTime.parse("2021-05-07T17:14:51Z"), model.observationEndTime());
        Assertions.assertEquals("bmehh", model.aggregationWindow());
    }
}
