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

package com.azure.resourcemanager.devtestlabs.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesProperties;
import com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesRequest;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class EvaluatePoliciesRequestTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        EvaluatePoliciesRequest model =
            BinaryData
                .fromString(
                    "{\"policies\":[{\"factName\":\"vkffovjzhpjb\",\"factData\":\"gjmfxumvfcl\",\"valueOffset\":\"ovwxnbkfezzxsc\",\"userObjectId\":\"wzdgirujbzbo\"}]}")
                .toObject(EvaluatePoliciesRequest.class);
        Assertions.assertEquals("vkffovjzhpjb", model.policies().get(0).factName());
        Assertions.assertEquals("gjmfxumvfcl", model.policies().get(0).factData());
        Assertions.assertEquals("ovwxnbkfezzxsc", model.policies().get(0).valueOffset());
        Assertions.assertEquals("wzdgirujbzbo", model.policies().get(0).userObjectId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        EvaluatePoliciesRequest model =
            new EvaluatePoliciesRequest()
                .withPolicies(
                    Arrays
                        .asList(
                            new EvaluatePoliciesProperties()
                                .withFactName("vkffovjzhpjb")
                                .withFactData("gjmfxumvfcl")
                                .withValueOffset("ovwxnbkfezzxsc")
                                .withUserObjectId("wzdgirujbzbo")));
        model = BinaryData.fromObject(model).toObject(EvaluatePoliciesRequest.class);
        Assertions.assertEquals("vkffovjzhpjb", model.policies().get(0).factName());
        Assertions.assertEquals("gjmfxumvfcl", model.policies().get(0).factData());
        Assertions.assertEquals("ovwxnbkfezzxsc", model.policies().get(0).valueOffset());
        Assertions.assertEquals("wzdgirujbzbo", model.policies().get(0).userObjectId());
    }
}
