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",
"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
}

View File

@ -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;
}
}
}

View File

@ -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
}

View File

@ -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;
}
}
}