// 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.SubscriptionUnderManagementGroupProperties;
import com.azure.resourcemanager.managementgroups.models.DescendantParentGroupInfo;
import org.junit.jupiter.api.Assertions;

public final class SubscriptionUnderManagementGroupPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SubscriptionUnderManagementGroupProperties model =
            BinaryData
                .fromString(
                    "{\"tenant\":\"ftadehxnltyfs\",\"displayName\":\"pusuesn\",\"parent\":{\"id\":\"ej\"},\"state\":\"vorxzdmohct\"}")
                .toObject(SubscriptionUnderManagementGroupProperties.class);
        Assertions.assertEquals("ftadehxnltyfs", model.tenant());
        Assertions.assertEquals("pusuesn", model.displayName());
        Assertions.assertEquals("ej", model.parent().id());
        Assertions.assertEquals("vorxzdmohct", model.state());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SubscriptionUnderManagementGroupProperties model =
            new SubscriptionUnderManagementGroupProperties()
                .withTenant("ftadehxnltyfs")
                .withDisplayName("pusuesn")
                .withParent(new DescendantParentGroupInfo().withId("ej"))
                .withState("vorxzdmohct");
        model = BinaryData.fromObject(model).toObject(SubscriptionUnderManagementGroupProperties.class);
        Assertions.assertEquals("ftadehxnltyfs", model.tenant());
        Assertions.assertEquals("pusuesn", model.displayName());
        Assertions.assertEquals("ej", model.parent().id());
        Assertions.assertEquals("vorxzdmohct", model.state());
    }
}
