// 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.RegulatoryComplianceControlInner;
import com.azure.resourcemanager.security.models.RegulatoryComplianceControlList;
import com.azure.resourcemanager.security.models.State;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class RegulatoryComplianceControlListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        RegulatoryComplianceControlList model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"description\":\"mbzonokix\",\"state\":\"Passed\",\"passedAssessments\":1122267125,\"failedAssessments\":1711524187,\"skippedAssessments\":2101008571},\"id\":\"frl\",\"name\":\"zszrnwoiindfpw\",\"type\":\"jylwbtlhflsj\"}],\"nextLink\":\"hszfjvfb\"}")
                .toObject(RegulatoryComplianceControlList.class);
        Assertions.assertEquals(State.PASSED, model.value().get(0).state());
    }

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