using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using Sirenix.Utilities;
using UnityEditor;
using UnityEngine;
using VOID.Generic.Dict;
using VOID.Generic.Objects.Accessory;

namespace Test.EditMode.Prefabs.Generic
{
    public class NecklaceObjectTest
    {
        private List<GameObject> _gameObjects = new();

        [OneTimeSetUp]
        public void Setup()
        {
            AssetDatabase.FindAssets($"t:{nameof(GameObject)}").ForEach(gameObjectGuid =>
            {
                var gameObjectPath = AssetDatabase.GUIDToAssetPath(gameObjectGuid);
                var gameObject = AssetDatabase.LoadAssetAtPath<GameObject>(gameObjectPath);
                var necklaceObjects = gameObject.GetComponentsInChildren<AccessoryObject>();

                // Only necklace for current testing
                if (necklaceObjects.All(necklace => necklace.accessoryData.accessoryType != AccessoryType.Necklace)) return;
                
                // If prefab have any AccessoryObject - take it, we will test it
                if (necklaceObjects.Length > 0) _gameObjects.Add(gameObject);
            });
        }

        [OneTimeTearDown]
        public void Cleanup()
        {
            _gameObjects?.Clear();
            _gameObjects = null;
        }

        [Test]
        public void NothingToTest()
        {
            
        }
    }
}

