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

public final class AzureFileshareProtectedItemExtendedInfoTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AzureFileshareProtectedItemExtendedInfo model =
            BinaryData
                .fromString(
                    "{\"oldestRecoveryPoint\":\"2021-05-13T12:50:34Z\",\"recoveryPointCount\":613728557,\"policyState\":\"vfoimwksli\",\"resourceState\":\"izjx\",\"resourceStateSyncTime\":\"2021-01-08T09:26:16Z\"}")
                .toObject(AzureFileshareProtectedItemExtendedInfo.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-05-13T12:50:34Z"), model.oldestRecoveryPoint());
        Assertions.assertEquals(613728557, model.recoveryPointCount());
        Assertions.assertEquals("vfoimwksli", model.policyState());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AzureFileshareProtectedItemExtendedInfo model =
            new AzureFileshareProtectedItemExtendedInfo()
                .withOldestRecoveryPoint(OffsetDateTime.parse("2021-05-13T12:50:34Z"))
                .withRecoveryPointCount(613728557)
                .withPolicyState("vfoimwksli");
        model = BinaryData.fromObject(model).toObject(AzureFileshareProtectedItemExtendedInfo.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-05-13T12:50:34Z"), model.oldestRecoveryPoint());
        Assertions.assertEquals(613728557, model.recoveryPointCount());
        Assertions.assertEquals("vfoimwksli", model.policyState());
    }
}
