I set up my test environment for PlayMode testing.
Tests marked with [Test]
work just fine, e.g. if my code looks like:
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
namespace Tests
{
public class WinTestSuite
{
[Test]
public void WinTestSuiteDummy()
{
Assert.IsTrue(false);
}
}
}
... and then run all tests, the Test Runner output looks like:
(as expected)
Tests marked [UnityTest]
seem to automatically pass without running, though. If I edit my test suite to look like this:
using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
namespace Tests
{
public class WinTestSuite
{
[UnityTest]
public IEnumerable WinTestSuiteDummy()
{
Debug.Log("Hello world");
yield return null;
Assert.IsTrue(false);
}
}
}
The output I'm seeing is:
Looks like it isn't even running (can't see the Hello world
anywhere), but I'm getting passing marks. What am I doing wrong?