Added root namespace for tests

This commit is contained in:
Jason Durand 2022-03-19 15:24:45 -04:00
parent 62fc52d9bd
commit 8ce2f36581
4 changed files with 70 additions and 43 deletions

View File

@ -1,9 +1,23 @@
{ {
"name": "EditMode", "name": "EditMode",
"optionalUnityReferences": [ "rootNamespace": "Squelette.Tests.EditMode",
"TestAssemblies" "references": [
"UnityEngine.TestRunner",
"UnityEditor.TestRunner"
], ],
"includePlatforms": [ "includePlatforms": [
"Editor" "Editor"
] ],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [
"nunit.framework.dll"
],
"autoReferenced": false,
"defineConstraints": [
"UNITY_INCLUDE_TESTS"
],
"versionDefines": [],
"noEngineReferences": false
} }

View File

@ -4,22 +4,21 @@ using NUnit.Framework;
using UnityEngine; using UnityEngine;
using UnityEngine.TestTools; using UnityEngine.TestTools;
public class Tests namespace Squelette.Tests.EditMode {
{ public class Tests {
// A Test behaves as an ordinary method // A Test behaves as an ordinary method
[Test] [Test]
public void TestsSimplePasses() public void TestsSimplePasses() {
{
// Use the Assert class to test conditions // Use the Assert class to test conditions
} }
// A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use // A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use
// `yield return null;` to skip a frame. // `yield return null;` to skip a frame.
[UnityTest] [UnityTest]
public IEnumerator TestsWithEnumeratorPasses() public IEnumerator TestsWithEnumeratorPasses() {
{
// Use the Assert class to test conditions. // Use the Assert class to test conditions.
// Use yield to skip a frame. // Use yield to skip a frame.
yield return null; yield return null;
} }
} }
}

View File

@ -1,6 +1,21 @@
{ {
"name": "PlayMode", "name": "PlayMode",
"optionalUnityReferences": [ "rootNamespace": "Squelette.Tests.PlayMode",
"TestAssemblies" "references": [
] "UnityEngine.TestRunner",
"UnityEditor.TestRunner"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [
"nunit.framework.dll"
],
"autoReferenced": false,
"defineConstraints": [
"UNITY_INCLUDE_TESTS"
],
"versionDefines": [],
"noEngineReferences": false
} }

View File

@ -4,22 +4,21 @@ using NUnit.Framework;
using UnityEngine; using UnityEngine;
using UnityEngine.TestTools; using UnityEngine.TestTools;
public class Tests namespace Squelette.Tests.PlayMode {
{ public class Tests {
// A Test behaves as an ordinary method // A Test behaves as an ordinary method
[Test] [Test]
public void TestsSimplePasses() public void TestsSimplePasses() {
{
// Use the Assert class to test conditions // Use the Assert class to test conditions
} }
// A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use // A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use
// `yield return null;` to skip a frame. // `yield return null;` to skip a frame.
[UnityTest] [UnityTest]
public IEnumerator TestsWithEnumeratorPasses() public IEnumerator TestsWithEnumeratorPasses() {
{
// Use the Assert class to test conditions. // Use the Assert class to test conditions.
// Use yield to skip a frame. // Use yield to skip a frame.
yield return null; yield return null;
} }
} }
}