// 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.DescendantParentGroupInfo;
import org.junit.jupiter.api.Assertions;

public final class DescendantInfoInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DescendantInfoInner model =
            BinaryData
                .fromString(
                    "{\"id\":\"ivkwlzuvccfwnfnb\",\"type\":\"fionl\",\"name\":\"x\",\"properties\":{\"displayName\":\"gtzxdpn\",\"parent\":{\"id\":\"qwxrjfeallnw\"}}}")
                .toObject(DescendantInfoInner.class);
        Assertions.assertEquals("gtzxdpn", model.displayName());
        Assertions.assertEquals("qwxrjfeallnw", model.parent().id());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DescendantInfoInner model =
            new DescendantInfoInner()
                .withDisplayName("gtzxdpn")
                .withParent(new DescendantParentGroupInfo().withId("qwxrjfeallnw"));
        model = BinaryData.fromObject(model).toObject(DescendantInfoInner.class);
        Assertions.assertEquals("gtzxdpn", model.displayName());
        Assertions.assertEquals("qwxrjfeallnw", model.parent().id());
    }
}
