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

package com.azure.resourcemanager.databoxedge.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryInner;
import java.time.OffsetDateTime;
import org.junit.jupiter.api.Assertions;

public final class UpdateSummaryInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        UpdateSummaryInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"deviceVersionNumber\":\"ggkzzlvmbmpa\",\"friendlyDeviceVersionName\":\"odfvuefywsbp\",\"deviceLastScannedDateTime\":\"2021-09-23T19:46:07Z\",\"lastCompletedScanJobDateTime\":\"2021-11-18T13:44:32Z\",\"lastCompletedDownloadJobDateTime\":\"2021-05-07T00:25:25Z\",\"lastCompletedInstallJobDateTime\":\"2021-03-30T01:45:45Z\",\"totalNumberOfUpdatesAvailable\":192759077,\"totalNumberOfUpdatesPendingDownload\":1120299710,\"totalNumberOfUpdatesPendingInstall\":938616277,\"rebootBehavior\":\"RequiresReboot\",\"ongoingUpdateOperation\":\"Install\",\"inProgressDownloadJobId\":\"yzvqt\",\"inProgressInstallJobId\":\"ubex\",\"inProgressDownloadJobStartedDateTime\":\"2021-04-19T22:54:33Z\",\"inProgressInstallJobStartedDateTime\":\"2021-05-08T13:31:38Z\",\"updateTitles\":[\"ndjmquxvyp\",\"mg\"],\"totalUpdateSizeInBytes\":50.27622509760092},\"id\":\"whojvp\",\"name\":\"jqg\",\"type\":\"ysmocmbqfqvmkcxo\"}")
                .toObject(UpdateSummaryInner.class);
        Assertions.assertEquals("ggkzzlvmbmpa", model.deviceVersionNumber());
        Assertions.assertEquals("odfvuefywsbp", model.friendlyDeviceVersionName());
        Assertions.assertEquals(OffsetDateTime.parse("2021-09-23T19:46:07Z"), model.deviceLastScannedDateTime());
        Assertions.assertEquals(OffsetDateTime.parse("2021-11-18T13:44:32Z"), model.lastCompletedScanJobDateTime());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        UpdateSummaryInner model =
            new UpdateSummaryInner()
                .withDeviceVersionNumber("ggkzzlvmbmpa")
                .withFriendlyDeviceVersionName("odfvuefywsbp")
                .withDeviceLastScannedDateTime(OffsetDateTime.parse("2021-09-23T19:46:07Z"))
                .withLastCompletedScanJobDateTime(OffsetDateTime.parse("2021-11-18T13:44:32Z"));
        model = BinaryData.fromObject(model).toObject(UpdateSummaryInner.class);
        Assertions.assertEquals("ggkzzlvmbmpa", model.deviceVersionNumber());
        Assertions.assertEquals("odfvuefywsbp", model.friendlyDeviceVersionName());
        Assertions.assertEquals(OffsetDateTime.parse("2021-09-23T19:46:07Z"), model.deviceLastScannedDateTime());
        Assertions.assertEquals(OffsetDateTime.parse("2021-11-18T13:44:32Z"), model.lastCompletedScanJobDateTime());
    }
}
