// 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.Update;
import java.time.OffsetDateTime;
import org.junit.jupiter.api.Assertions;

public final class UpdateTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        Update model =
            BinaryData
                .fromString("{\"summary\":\"dw\",\"updateDateTime\":\"2021-08-04T11:26:15Z\"}")
                .toObject(Update.class);
        Assertions.assertEquals("dw", model.summary());
        Assertions.assertEquals(OffsetDateTime.parse("2021-08-04T11:26:15Z"), model.updateDateTime());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        Update model = new Update().withSummary("dw").withUpdateDateTime(OffsetDateTime.parse("2021-08-04T11:26:15Z"));
        model = BinaryData.fromObject(model).toObject(Update.class);
        Assertions.assertEquals("dw", model.summary());
        Assertions.assertEquals(OffsetDateTime.parse("2021-08-04T11:26:15Z"), model.updateDateTime());
    }
}
