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

package com.azure.resourcemanager.recoveryservicesbackup.generated;

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

public final class MabFileFolderProtectedItemExtendedInfoTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MabFileFolderProtectedItemExtendedInfo model =
            BinaryData
                .fromString(
                    "{\"lastRefreshedAt\":\"2021-05-19T03:14:53Z\",\"oldestRecoveryPoint\":\"2021-06-11T14:56:28Z\",\"recoveryPointCount\":109793124}")
                .toObject(MabFileFolderProtectedItemExtendedInfo.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-05-19T03:14:53Z"), model.lastRefreshedAt());
        Assertions.assertEquals(OffsetDateTime.parse("2021-06-11T14:56:28Z"), model.oldestRecoveryPoint());
        Assertions.assertEquals(109793124, model.recoveryPointCount());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MabFileFolderProtectedItemExtendedInfo model =
            new MabFileFolderProtectedItemExtendedInfo()
                .withLastRefreshedAt(OffsetDateTime.parse("2021-05-19T03:14:53Z"))
                .withOldestRecoveryPoint(OffsetDateTime.parse("2021-06-11T14:56:28Z"))
                .withRecoveryPointCount(109793124);
        model = BinaryData.fromObject(model).toObject(MabFileFolderProtectedItemExtendedInfo.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-05-19T03:14:53Z"), model.lastRefreshedAt());
        Assertions.assertEquals(OffsetDateTime.parse("2021-06-11T14:56:28Z"), model.oldestRecoveryPoint());
        Assertions.assertEquals(109793124, model.recoveryPointCount());
    }
}
