Code/Framework/AzToolsFramework/Tests/InstanceDataHierarchy.cpp
TEST_P(InstanceDataHierarchyGroupTestFixtureParameterized, ValidatingGroupAndSubGroupParents)
    {
        using AzToolsFramework::InstanceDataHierarchy;
        using AzToolsFramework::InstanceDataNode;

        const char* paramName = GetParam();
        for (auto child : componentNode1->GetChildren())
        {
            AZStd::string childName(child.GetElementMetadata()->m_name);
            if (childName.compare(paramName) == 0)
            {
                EXPECT_STREQ(child.GetParent()->GetClassMetadata()->m_name, "GroupTestComponent");
            }
            if ((childName.compare("SubDataNormal") == 0) || (childName.compare("SubDataToggle") == 0))
            {
                for (auto subChild : child.GetChildren())
                {
                    childName = subChild.GetElementMetadata()->m_name;
                    if (childName.compare(paramName) == 0)
                    {
                        EXPECT_STREQ(subChild.GetParent()->GetClassMetadata()->m_name, "SubData");
                    }
                }
            }
        }
    }
// Test to validate that each node in a group and Subgroup has the correct parent
Test to validate that each node in a group and Subgroup has the correct parent
Test to validate that each node in a group and Subgroup has the correct parent
TEST_P(InstanceDataHierarchyGroupTestFixtureParameterized, ValidatingGroupAndSubGroupParents)
    {
        using AzToolsFramework::InstanceDataHierarchy;
        using AzToolsFramework::InstanceDataNode;
        const char* paramName = GetParam();
        for (auto child : componentNode1->GetChildren())
        {
            AZStd::string childName(child.GetElementMetadata()->m_name);
            if (childName.compare(paramName) == 0)
            {
                EXPECT_STREQ(child.GetParent()->GetClassMetadata()->m_name, "GroupTestComponent");
            }
            if ((childName.compare("SubDataNormal") == 0) || (childName.compare("SubDataToggle") == 0))
            {
                for (auto subChild : child.GetChildren())
                {
                    childName = subChild.GetElementMetadata()->m_name;
                    if (childName.compare(paramName) == 0)
                    {
                        EXPECT_STREQ(subChild.GetParent()->GetClassMetadata()->m_name, "SubData");
                    }
                }
            }
        }
    }
TEST_P ( InstanceDataHierarchyGroupTestFixtureParameterized , ValidatingGroupAndSubGroupParents ) { using AzToolsFramework :: InstanceDataHierarchy ; using AzToolsFramework :: InstanceDataNode ; const char * paramName = GetParam ( ) ; for ( auto child : componentNode1 -> GetChildren ( ) ) { AZStd :: string childName ( child . GetElementMetadata ( ) -> m_name ) ; if ( childName . compare ( paramName ) == 0 ) { EXPECT_STREQ ( child . GetParent ( ) -> GetClassMetadata ( ) -> m_name , " " ) ; } if ( ( childName . compare ( " " ) == 0 ) || ( childName . compare ( " " ) == 0 ) ) { for ( auto subChild : child . GetChildren ( ) ) { childName = subChild . GetElementMetadata ( ) -> m_name ; if ( childName . compare ( paramName ) == 0 ) { EXPECT_STREQ ( subChild . GetParent ( ) -> GetClassMetadata ( ) -> m_name , " " ) ; } } } } }
Test to validate that each node in a group and Subgroup has the correct parent
Test to validate that each node in a group and Subgroup has the correct parent