A game about forced loneliness, made by TACStudios
1using System; 2 3namespace UnityEditor.TestTools.TestRunner.GUI.TestAssets 4{ 5 /// <summary> 6 /// The set of Menu Items dedicated to creating test assets: Test Scripts and Custom Test Assemblies. 7 /// </summary> 8 internal static class TestScriptAssetMenuItems 9 { 10 internal const string addNewFolderWithTestAssemblyDefinitionMenuItem = "Assets/Create/Testing/Tests Assembly Folder"; 11 internal const string addNewTestScriptMenuItem = "Assets/Create/Testing/C# Test Script"; 12 13 /// <summary> 14 /// Adds a new folder asset and an associated Custom Test Assembly in the active folder path. 15 /// </summary> 16 [MenuItem(addNewFolderWithTestAssemblyDefinitionMenuItem, false, 83)] 17 public static void AddNewFolderWithTestAssemblyDefinition() 18 { 19 TestScriptAssetsCreator.Instance.AddNewFolderWithTestAssemblyDefinition(); 20 } 21 22 /// <summary> 23 /// Checks if it is possible to add a new Custom Test Assembly inside the active folder path. 24 /// </summary> 25 /// <returns>False if the active folder path already contains a Custom Test Assembly; true otherwise.</returns> 26 [MenuItem(addNewFolderWithTestAssemblyDefinitionMenuItem, true, 83)] 27 public static bool CanAddNewFolderWithTestAssemblyDefinition() 28 { 29 var testAssemblyAlreadyExists = TestScriptAssetsCreator.Instance.ActiveFolderContainsTestAssemblyDefinition(); 30 return !testAssemblyAlreadyExists; 31 } 32 33 /// <summary> 34 /// Adds a new Test Script asset in the active folder path. 35 /// </summary> 36 [MenuItem(addNewTestScriptMenuItem, false, 83)] 37 public static void AddNewTestScript() 38 { 39 TestScriptAssetsCreator.Instance.AddNewTestScript(); 40 } 41 42 /// <summary> 43 /// Checks if it is possible to add a new Test Script in the active folder path. 44 /// </summary> 45 /// <returns>True if a Test Script can be compiled in the active folder path; false otherwise.</returns> 46 [MenuItem(addNewTestScriptMenuItem, true, 83)] 47 public static bool CanAddNewTestScript() 48 { 49 var testScriptWillCompile = TestScriptAssetsCreator.Instance.TestScriptWillCompileInActiveFolder(); 50 return testScriptWillCompile; 51 } 52 } 53}