From 8ce2f36581bb362e6e138dfdb0eb9cb36a84c993 Mon Sep 17 00:00:00 2001 From: Jason Durand Date: Sat, 19 Mar 2022 15:24:45 -0400 Subject: [PATCH] Added root namespace for tests --- Assets/Tests/EditMode/EditMode.asmdef | 20 ++++++++++++--- Assets/Tests/EditMode/Tests.cs | 35 +++++++++++++-------------- Assets/Tests/PlayMode/PlayMode.asmdef | 23 +++++++++++++++--- Assets/Tests/PlayMode/Tests.cs | 35 +++++++++++++-------------- 4 files changed, 70 insertions(+), 43 deletions(-) diff --git a/Assets/Tests/EditMode/EditMode.asmdef b/Assets/Tests/EditMode/EditMode.asmdef index a2df90a..d1121d8 100644 --- a/Assets/Tests/EditMode/EditMode.asmdef +++ b/Assets/Tests/EditMode/EditMode.asmdef @@ -1,9 +1,23 @@ { "name": "EditMode", - "optionalUnityReferences": [ - "TestAssemblies" + "rootNamespace": "Squelette.Tests.EditMode", + "references": [ + "UnityEngine.TestRunner", + "UnityEditor.TestRunner" ], "includePlatforms": [ "Editor" - ] + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": true, + "precompiledReferences": [ + "nunit.framework.dll" + ], + "autoReferenced": false, + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ], + "versionDefines": [], + "noEngineReferences": false } \ No newline at end of file diff --git a/Assets/Tests/EditMode/Tests.cs b/Assets/Tests/EditMode/Tests.cs index 629508f..e726e06 100644 --- a/Assets/Tests/EditMode/Tests.cs +++ b/Assets/Tests/EditMode/Tests.cs @@ -4,22 +4,21 @@ using NUnit.Framework; using UnityEngine; using UnityEngine.TestTools; -public class Tests -{ - // A Test behaves as an ordinary method - [Test] - public void TestsSimplePasses() - { - // Use the Assert class to test conditions - } +namespace Squelette.Tests.EditMode { + public class Tests { + // A Test behaves as an ordinary method + [Test] + public void TestsSimplePasses() { + // Use the Assert class to test conditions + } - // A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use - // `yield return null;` to skip a frame. - [UnityTest] - public IEnumerator TestsWithEnumeratorPasses() - { - // Use the Assert class to test conditions. - // Use yield to skip a frame. - yield return null; - } -} + // A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use + // `yield return null;` to skip a frame. + [UnityTest] + public IEnumerator TestsWithEnumeratorPasses() { + // Use the Assert class to test conditions. + // Use yield to skip a frame. + yield return null; + } + } +} \ No newline at end of file diff --git a/Assets/Tests/PlayMode/PlayMode.asmdef b/Assets/Tests/PlayMode/PlayMode.asmdef index 5c77dfe..de12a4e 100644 --- a/Assets/Tests/PlayMode/PlayMode.asmdef +++ b/Assets/Tests/PlayMode/PlayMode.asmdef @@ -1,6 +1,21 @@ { "name": "PlayMode", - "optionalUnityReferences": [ - "TestAssemblies" - ] -} + "rootNamespace": "Squelette.Tests.PlayMode", + "references": [ + "UnityEngine.TestRunner", + "UnityEditor.TestRunner" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": true, + "precompiledReferences": [ + "nunit.framework.dll" + ], + "autoReferenced": false, + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Tests/PlayMode/Tests.cs b/Assets/Tests/PlayMode/Tests.cs index 629508f..cabde06 100644 --- a/Assets/Tests/PlayMode/Tests.cs +++ b/Assets/Tests/PlayMode/Tests.cs @@ -4,22 +4,21 @@ using NUnit.Framework; using UnityEngine; using UnityEngine.TestTools; -public class Tests -{ - // A Test behaves as an ordinary method - [Test] - public void TestsSimplePasses() - { - // Use the Assert class to test conditions - } +namespace Squelette.Tests.PlayMode { + public class Tests { + // A Test behaves as an ordinary method + [Test] + public void TestsSimplePasses() { + // Use the Assert class to test conditions + } - // A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use - // `yield return null;` to skip a frame. - [UnityTest] - public IEnumerator TestsWithEnumeratorPasses() - { - // Use the Assert class to test conditions. - // Use yield to skip a frame. - yield return null; - } -} + // A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use + // `yield return null;` to skip a frame. + [UnityTest] + public IEnumerator TestsWithEnumeratorPasses() { + // Use the Assert class to test conditions. + // Use yield to skip a frame. + yield return null; + } + } +} \ No newline at end of file