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

package com.azure.resourcemanager.dataprotection.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.dataprotection.models.SoftDeleteSettings;
import com.azure.resourcemanager.dataprotection.models.SoftDeleteState;
import org.junit.jupiter.api.Assertions;

public final class SoftDeleteSettingsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SoftDeleteSettings model =
            BinaryData
                .fromString("{\"state\":\"On\",\"retentionDurationInDays\":93.01724581191532}")
                .toObject(SoftDeleteSettings.class);
        Assertions.assertEquals(SoftDeleteState.ON, model.state());
        Assertions.assertEquals(93.01724581191532D, model.retentionDurationInDays());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SoftDeleteSettings model =
            new SoftDeleteSettings().withState(SoftDeleteState.ON).withRetentionDurationInDays(93.01724581191532D);
        model = BinaryData.fromObject(model).toObject(SoftDeleteSettings.class);
        Assertions.assertEquals(SoftDeleteState.ON, model.state());
        Assertions.assertEquals(93.01724581191532D, model.retentionDurationInDays());
    }
}
