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

package com.azure.resourcemanager.policyinsights.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.policyinsights.models.PendingField;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class PendingFieldTests {
    @Test
    public void testDeserialize() {
        PendingField model =
            BinaryData
                .fromString(
                    "{\"field\":\"wczelpci\",\"values\":[\"sfeaenwabfat\",\"lddxbjhwua\",\"nozj\",\"sphyoulpjrvxa\"]}")
                .toObject(PendingField.class);
        Assertions.assertEquals("wczelpci", model.field());
        Assertions.assertEquals("sfeaenwabfat", model.values().get(0));
    }

    @Test
    public void testSerialize() {
        PendingField model =
            new PendingField()
                .withField("wczelpci")
                .withValues(Arrays.asList("sfeaenwabfat", "lddxbjhwua", "nozj", "sphyoulpjrvxa"));
        model = BinaryData.fromObject(model).toObject(PendingField.class);
        Assertions.assertEquals("wczelpci", model.field());
        Assertions.assertEquals("sfeaenwabfat", model.values().get(0));
    }
}
