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

package com.azure.resourcemanager.resourcehealth.generated;

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

public final class AvailabilityStatusPropertiesRecentlyResolvedTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AvailabilityStatusPropertiesRecentlyResolved model =
            BinaryData
                .fromString(
                    "{\"unavailableOccuredTime\":\"2021-03-20T08:29Z\",\"resolvedTime\":\"2021-05-05T10:20:27Z\",\"unavailableSummary\":\"ddgmb\"}")
                .toObject(AvailabilityStatusPropertiesRecentlyResolved.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-03-20T08:29Z"), model.unavailableOccuredTime());
        Assertions.assertEquals(OffsetDateTime.parse("2021-05-05T10:20:27Z"), model.resolvedTime());
        Assertions.assertEquals("ddgmb", model.unavailableSummary());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AvailabilityStatusPropertiesRecentlyResolved model =
            new AvailabilityStatusPropertiesRecentlyResolved()
                .withUnavailableOccuredTime(OffsetDateTime.parse("2021-03-20T08:29Z"))
                .withResolvedTime(OffsetDateTime.parse("2021-05-05T10:20:27Z"))
                .withUnavailableSummary("ddgmb");
        model = BinaryData.fromObject(model).toObject(AvailabilityStatusPropertiesRecentlyResolved.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-03-20T08:29Z"), model.unavailableOccuredTime());
        Assertions.assertEquals(OffsetDateTime.parse("2021-05-05T10:20:27Z"), model.resolvedTime());
        Assertions.assertEquals("ddgmb", model.unavailableSummary());
    }
}
