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

package com.azure.resourcemanager.synapse.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.synapse.fluent.models.GeoBackupPolicyInner;
import com.azure.resourcemanager.synapse.models.GeoBackupPolicyListResult;
import com.azure.resourcemanager.synapse.models.GeoBackupPolicyState;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class GeoBackupPolicyListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        GeoBackupPolicyListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"state\":\"Enabled\",\"storageType\":\"v\"},\"kind\":\"jkbegibtnmxiebww\",\"location\":\"oayqc\",\"id\":\"wrtz\",\"name\":\"uzgwyzmhtx\",\"type\":\"ngmtsavjcb\"},{\"properties\":{\"state\":\"Enabled\",\"storageType\":\"qpsrknftguvri\"},\"kind\":\"prwmdyvxqt\",\"location\":\"riwwroy\",\"id\":\"bexrmcq\",\"name\":\"bycnojvkn\",\"type\":\"e\"},{\"properties\":{\"state\":\"Enabled\",\"storageType\":\"gzva\"},\"kind\":\"pjyzhpv\",\"location\":\"zcjrvxdjzlmwlx\",\"id\":\"vu\",\"name\":\"fhzovawjvzunluth\",\"type\":\"n\"},{\"properties\":{\"state\":\"Disabled\",\"storageType\":\"xipeilpjzuaejx\"},\"kind\":\"ltskzbbtd\",\"location\":\"mv\",\"id\":\"ekg\",\"name\":\"wozuhkf\",\"type\":\"bsjyofdx\"}]}")
                .toObject(GeoBackupPolicyListResult.class);
        Assertions.assertEquals(GeoBackupPolicyState.ENABLED, model.value().get(0).state());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        GeoBackupPolicyListResult model =
            new GeoBackupPolicyListResult()
                .withValue(
                    Arrays
                        .asList(
                            new GeoBackupPolicyInner().withState(GeoBackupPolicyState.ENABLED),
                            new GeoBackupPolicyInner().withState(GeoBackupPolicyState.ENABLED),
                            new GeoBackupPolicyInner().withState(GeoBackupPolicyState.ENABLED),
                            new GeoBackupPolicyInner().withState(GeoBackupPolicyState.DISABLED)));
        model = BinaryData.fromObject(model).toObject(GeoBackupPolicyListResult.class);
        Assertions.assertEquals(GeoBackupPolicyState.ENABLED, model.value().get(0).state());
    }
}
