using System; namespace UnityEditor.TestTools.TestRunner.GUI.TestAssets { /// /// The set of Menu Items dedicated to creating test assets: Test Scripts and Custom Test Assemblies. /// internal static class TestScriptAssetMenuItems { internal const string addNewFolderWithTestAssemblyDefinitionMenuItem = "Assets/Create/Testing/Tests Assembly Folder"; internal const string addNewTestScriptMenuItem = "Assets/Create/Testing/C# Test Script"; /// /// Adds a new folder asset and an associated Custom Test Assembly in the active folder path. /// [MenuItem(addNewFolderWithTestAssemblyDefinitionMenuItem, false, 83)] public static void AddNewFolderWithTestAssemblyDefinition() { TestScriptAssetsCreator.Instance.AddNewFolderWithTestAssemblyDefinition(); } /// /// Checks if it is possible to add a new Custom Test Assembly inside the active folder path. /// /// False if the active folder path already contains a Custom Test Assembly; true otherwise. [MenuItem(addNewFolderWithTestAssemblyDefinitionMenuItem, true, 83)] public static bool CanAddNewFolderWithTestAssemblyDefinition() { var testAssemblyAlreadyExists = TestScriptAssetsCreator.Instance.ActiveFolderContainsTestAssemblyDefinition(); return !testAssemblyAlreadyExists; } /// /// Adds a new Test Script asset in the active folder path. /// [MenuItem(addNewTestScriptMenuItem, false, 83)] public static void AddNewTestScript() { TestScriptAssetsCreator.Instance.AddNewTestScript(); } /// /// Checks if it is possible to add a new Test Script in the active folder path. /// /// True if a Test Script can be compiled in the active folder path; false otherwise. [MenuItem(addNewTestScriptMenuItem, true, 83)] public static bool CanAddNewTestScript() { var testScriptWillCompile = TestScriptAssetsCreator.Instance.TestScriptWillCompileInActiveFolder(); return testScriptWillCompile; } } }