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

package com.azure.resourcemanager.recoveryservices.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.recoveryservices.models.CrossSubscriptionRestoreSettings;
import com.azure.resourcemanager.recoveryservices.models.CrossSubscriptionRestoreState;
import com.azure.resourcemanager.recoveryservices.models.RestoreSettings;
import org.junit.jupiter.api.Assertions;

public final class RestoreSettingsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        RestoreSettings model =
            BinaryData
                .fromString("{\"crossSubscriptionRestoreSettings\":{\"crossSubscriptionRestoreState\":\"Disabled\"}}")
                .toObject(RestoreSettings.class);
        Assertions
            .assertEquals(
                CrossSubscriptionRestoreState.DISABLED,
                model.crossSubscriptionRestoreSettings().crossSubscriptionRestoreState());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        RestoreSettings model =
            new RestoreSettings()
                .withCrossSubscriptionRestoreSettings(
                    new CrossSubscriptionRestoreSettings()
                        .withCrossSubscriptionRestoreState(CrossSubscriptionRestoreState.DISABLED));
        model = BinaryData.fromObject(model).toObject(RestoreSettings.class);
        Assertions
            .assertEquals(
                CrossSubscriptionRestoreState.DISABLED,
                model.crossSubscriptionRestoreSettings().crossSubscriptionRestoreState());
    }
}
