<commit_before>﻿
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using UnityEngine;
using UnityEditor;
using System.Linq;

namespace Tests
{
	public class MissingAssetReferences 
	{
		[Test]
		public void TestAllChannelsTag()
		{
			List<string> listResult = new List<string>();
			string[] allPrefabs = SearchAndDestroy.GetAllPrefabs();
			foreach (string prefab in allPrefabs)
			{
				Object o = AssetDatabase.LoadMainAssetAtPath(prefab);
				GameObject go;
				try
				{
					go = (GameObject)o;
					Component[] components = go.GetComponentsInChildren<Component>(true);
					foreach (Component c in components)
					{
						if (c == null)
						{
							listResult.Add(prefab);
						}
					}
				}
				catch
				{
					Logger.LogFormat("For some reason, prefab {0} won't cast to GameObject", Category.UI, prefab);
				}
			}

			foreach (string s in listResult)
			{
				Debug.LogFormat("Missing reference found in prefab {0}", s);
			}

			Assert.IsEmpty(listResult, "Missing references found: {0}", listResult.Aggregate((i, j) => i + "," + j));
		}
	}
}<commit_msg>Handles missing reference test passing properly<commit_after>﻿
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using UnityEngine;
using UnityEditor;
using System.Linq;

namespace Tests
{
	public class MissingAssetReferences 
	{
		[Test]
		public void TestAllChannelsTag()
		{
			List<string> listResult = new List<string>();
			string[] allPrefabs = SearchAndDestroy.GetAllPrefabs();
			foreach (string prefab in allPrefabs)
			{
				Object o = AssetDatabase.LoadMainAssetAtPath(prefab);
				GameObject go;
				try
				{
					go = (GameObject)o;
					Component[] components = go.GetComponentsInChildren<Component>(true);
					foreach (Component c in components)
					{
						if (c == null)
						{
							listResult.Add(prefab);
						}
					}
				}
				catch
				{
					Logger.LogFormat("For some reason, prefab {0} won't cast to GameObject", Category.UI, prefab);
				}
			}

			foreach (string s in listResult)
			{
				Debug.LogFormat("Missing reference found in prefab {0}", s);
			}

			Assert.IsEmpty(listResult, "Missing references found: {0}", (listResult.Count==0? "None" : listResult.Aggregate((i, j) => i + "," + j)));
		}
	}
}
{'fraction_non_alphanumeric': 0.11875547765118318, 'fraction_numerical': 0.003067484662576687, 'mean_word_length': 3.2913533834586466, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3831324', 'n_tokens_mistral': 907, 'n_tokens_neox': 707, 'n_words': 181}