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

public final class AzureFileShareBackupRequestTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AzureFileShareBackupRequest model =
            BinaryData
                .fromString(
                    "{\"objectType\":\"AzureFileShareBackupRequest\",\"recoveryPointExpiryTimeInUTC\":\"2021-01-31T11:09:27Z\"}")
                .toObject(AzureFileShareBackupRequest.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T11:09:27Z"), model.recoveryPointExpiryTimeInUtc());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AzureFileShareBackupRequest model =
            new AzureFileShareBackupRequest()
                .withRecoveryPointExpiryTimeInUtc(OffsetDateTime.parse("2021-01-31T11:09:27Z"));
        model = BinaryData.fromObject(model).toObject(AzureFileShareBackupRequest.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T11:09:27Z"), model.recoveryPointExpiryTimeInUtc());
    }
}
