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

package com.azure.resourcemanager.security.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner;
import com.azure.resourcemanager.security.models.RegulatoryComplianceStandardList;
import com.azure.resourcemanager.security.models.State;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class RegulatoryComplianceStandardListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        RegulatoryComplianceStandardList model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"state\":\"Skipped\",\"passedControls\":1997907611,\"failedControls\":2111279751,\"skippedControls\":1073194543,\"unsupportedControls\":387671304},\"id\":\"p\",\"name\":\"jxbkzbzkdvn\",\"type\":\"jabudurgkakmo\"},{\"properties\":{\"state\":\"Failed\",\"passedControls\":893447379,\"failedControls\":873562090,\"skippedControls\":1182691834,\"unsupportedControls\":783879068},\"id\":\"uwqlgzrfzeey\",\"name\":\"bizikayuhq\",\"type\":\"bjbsybb\"},{\"properties\":{\"state\":\"Unsupported\",\"passedControls\":948234782,\"failedControls\":1918019278,\"skippedControls\":348550148,\"unsupportedControls\":1644492935},\"id\":\"vm\",\"name\":\"ipaslthaqfxssmwu\",\"type\":\"wbdsr\"}],\"nextLink\":\"pdrhne\"}")
                .toObject(RegulatoryComplianceStandardList.class);
        Assertions.assertEquals(State.SKIPPED, model.value().get(0).state());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        RegulatoryComplianceStandardList model =
            new RegulatoryComplianceStandardList()
                .withValue(
                    Arrays
                        .asList(
                            new RegulatoryComplianceStandardInner().withState(State.SKIPPED),
                            new RegulatoryComplianceStandardInner().withState(State.FAILED),
                            new RegulatoryComplianceStandardInner().withState(State.UNSUPPORTED)));
        model = BinaryData.fromObject(model).toObject(RegulatoryComplianceStandardList.class);
        Assertions.assertEquals(State.SKIPPED, model.value().get(0).state());
    }
}
