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

package com.azure.resourcemanager.managementgroups.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.managementgroups.fluent.models.DescendantInfoInner;
import com.azure.resourcemanager.managementgroups.models.DescendantListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class DescendantListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DescendantListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"id\":\"rvqdra\",\"type\":\"jybige\",\"name\":\"qfbow\",\"properties\":{\"displayName\":\"nyktzlcuiy\"}},{\"id\":\"ywgndrv\",\"type\":\"hzgpphrcgyncocpe\",\"name\":\"vmmcoofs\",\"properties\":{\"displayName\":\"evgbmqjq\"}}],\"nextLink\":\"y\"}")
                .toObject(DescendantListResult.class);
        Assertions.assertEquals("nyktzlcuiy", model.value().get(0).displayName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DescendantListResult model =
            new DescendantListResult()
                .withValue(
                    Arrays
                        .asList(
                            new DescendantInfoInner().withDisplayName("nyktzlcuiy"),
                            new DescendantInfoInner().withDisplayName("evgbmqjq")));
        model = BinaryData.fromObject(model).toObject(DescendantListResult.class);
        Assertions.assertEquals("nyktzlcuiy", model.value().get(0).displayName());
    }
}
