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

public final class IaasVMBackupRequestTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        IaasVMBackupRequest model =
            BinaryData
                .fromString(
                    "{\"objectType\":\"IaasVMBackupRequest\",\"recoveryPointExpiryTimeInUTC\":\"2021-07-16T03:52:17Z\"}")
                .toObject(IaasVMBackupRequest.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-07-16T03:52:17Z"), model.recoveryPointExpiryTimeInUtc());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        IaasVMBackupRequest model =
            new IaasVMBackupRequest().withRecoveryPointExpiryTimeInUtc(OffsetDateTime.parse("2021-07-16T03:52:17Z"));
        model = BinaryData.fromObject(model).toObject(IaasVMBackupRequest.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-07-16T03:52:17Z"), model.recoveryPointExpiryTimeInUtc());
    }
}
