com.valectric.mooserunner 2.1.21 → 2.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -23
- package/CLI~/mooserunnerCli.exe +0 -0
- package/CLI~/mooserunnerCliDaemon.exe +0 -0
- package/Editor/HotReloadIntegration/MooseRunner.HotReloadIntegration.dll +0 -0
- package/Editor/HotReloadIntegration/MooseRunner.HotReloadIntegration.dll.meta +32 -32
- package/Editor/MooseRunner.Editor.asmdef +15 -15
- package/Editor/MooseRunner.Editor.asmdef.meta +6 -6
- package/Editor/MooseRunner.Internal.Editor.dll +0 -0
- package/Editor/MooseRunner.Internal.Editor.dll.meta +32 -32
- package/Editor/MooseRunner.Worker.dll +0 -0
- package/Editor/MooseRunner.Worker.dll.meta +32 -32
- package/Editor/SessionRecorder/MooseRunner.SessionRecorder.dll +0 -0
- package/Editor/SessionRecorder/MooseRunner.SessionRecorder.dll.meta +32 -32
- package/Editor/_WrapperStub.cs.meta +10 -10
- package/LICENSE.md +28 -28
- package/Runtime/MooseRunner.Helpers.Runtime.dll +0 -0
- package/Runtime/MooseRunner.Helpers.Runtime.dll.meta +26 -26
- package/Runtime/MooseRunner.Internal.dll +0 -0
- package/Runtime/MooseRunner.Internal.dll.meta +26 -26
- package/Runtime/MooseRunner.Multiplaytest.Types.dll +0 -0
- package/Runtime/MooseRunner.Multiplaytest.Types.dll.meta +26 -26
- package/Runtime/MooseRunner.Runtime.asmdef +15 -15
- package/Runtime/MooseRunner.Runtime.asmdef.meta +6 -6
- package/Runtime/MooseRunner.SessionRecorder.Public.dll +0 -0
- package/Runtime/MooseRunner.SessionRecorder.Public.dll.meta +26 -26
- package/Runtime/MooseRunner.SessionRecorder.Runtime.dll +0 -0
- package/Runtime/MooseRunner.SessionRecorder.Runtime.dll.meta +26 -26
- package/Runtime/MooseRunner.dll +0 -0
- package/Runtime/MooseRunner.dll.meta +26 -26
- package/Runtime/_WrapperStub.cs.meta +10 -10
- package/Samples~/Demos/MooseRunner.Demo.CancellationTokens.Tests/BatchCancellationTests.cs +37 -37
- package/Samples~/Demos/MooseRunner.Demo.CancellationTokens.Tests/CancellationTokenTests.cs +186 -186
- package/Samples~/Demos/MooseRunner.Demo.CancellationTokens.Tests/SetupTeardownCancellationTests.cs +85 -85
- package/Samples~/Demos/MooseRunner.Demo.Flow.TestSupport/LogEntry.cs +51 -51
- package/Samples~/Demos/MooseRunner.Demo.Flow.TestSupport/LogFileParser.cs +69 -69
- package/Samples~/Demos/MooseRunner.Demo.OrderAttribute/MethodOrderAttributeTests.cs +62 -62
- package/Samples~/Demos/MooseRunner.Demo.RealUseCase/Enemy.cs +100 -100
- package/Samples~/Demos/MooseRunner.Demo.RealUseCase/FireComponent.cs +18 -18
- package/Samples~/Demos/MooseRunner.Demo.Support/MessageDisplayManager.cs +291 -291
- package/Samples~/Demos/MooseRunner.Demo.Support/MooseRunnerSampleVersionCheck.cs +57 -57
- package/Samples~/Demos/MooseRunner.Demo.Support/MooseRunnerSampleVersionCheck.cs.meta +1 -1
- package/Samples~/Demos/MooseRunner.Demo.Tests/ExplicitAttributeTests.cs +36 -36
- package/Samples~/Demos/MooseRunner.Demo.Tests/InstanceHandlingVerificationTest.cs +99 -99
- package/Third Party Notices.md +37 -37
- package/package.json +1 -1
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
using System;
|
|
2
|
-
using System.IO;
|
|
3
|
-
using System.Linq;
|
|
4
|
-
using UnityEngine;
|
|
5
|
-
|
|
6
|
-
namespace MooseRunner.Internal.Tests
|
|
7
|
-
{
|
|
8
|
-
/// <summary>
|
|
9
|
-
/// Detects duplicate MooseRunner sample-version folders in Assets/Samples/.
|
|
10
|
-
/// Unity's UPM Sample import creates a new <c>Assets/Samples/MooseRunner/<version>/...</c>
|
|
11
|
-
/// folder on every upgrade and never deletes the previous one. The duplicate .cs files
|
|
12
|
-
/// share class FQNs (e.g. <c>MooseRunner.Internal.Tests.Enemy</c>) and stable .meta GUIDs,
|
|
13
|
-
/// which produces a "is not derived from MonoBehaviour or ScriptableObject!" runtime
|
|
14
|
-
/// error when prefabs instantiate. Called from each sample test's OneTimeSetUp so the
|
|
15
|
-
/// check fires only when the customer actually uses the samples.
|
|
16
|
-
/// </summary>
|
|
17
|
-
public static class MooseRunnerSampleVersionCheck
|
|
18
|
-
{
|
|
19
|
-
private static bool _alreadyChecked;
|
|
20
|
-
private const string SamplesRoot = "Assets/Samples/MooseRunner";
|
|
21
|
-
|
|
22
|
-
/// <summary>
|
|
23
|
-
/// Throws <see cref="InvalidOperationException"/> if multiple MooseRunner sample-version
|
|
24
|
-
/// folders are present. First call performs the scan; subsequent calls within the same
|
|
25
|
-
/// domain are no-ops (the flag resets on domain reload, which is fine — the check is
|
|
26
|
-
/// idempotent and cheap).
|
|
27
|
-
/// </summary>
|
|
28
|
-
public static void EnsureSingleVersion()
|
|
29
|
-
{
|
|
30
|
-
if (_alreadyChecked) return;
|
|
31
|
-
_alreadyChecked = true;
|
|
32
|
-
|
|
33
|
-
if (!Directory.Exists(SamplesRoot)) return;
|
|
34
|
-
|
|
35
|
-
var versionDirs = Directory.GetDirectories(SamplesRoot);
|
|
36
|
-
if (versionDirs.Length <= 1) return;
|
|
37
|
-
|
|
38
|
-
var sortedFolders = versionDirs
|
|
39
|
-
.Select(Path.GetFileName)
|
|
40
|
-
.OrderBy(n => n)
|
|
41
|
-
.Select(n => " " + SamplesRoot + "/" + n);
|
|
42
|
-
|
|
43
|
-
string msg =
|
|
44
|
-
"Multiple MooseRunner sample versions detected. Unity's UPM 'Reimport Sample' " +
|
|
45
|
-
"creates a new versioned folder on every package upgrade and never deletes the " +
|
|
46
|
-
"previous one. Duplicate .cs files with the same class FQN and stable .meta GUIDs " +
|
|
47
|
-
"produce the runtime error \"... is not derived from MonoBehaviour or ScriptableObject!\" " +
|
|
48
|
-
"when prefabs instantiate.\n" +
|
|
49
|
-
"\n" +
|
|
50
|
-
"Found:\n" + string.Join("\n", sortedFolders) + "\n" +
|
|
51
|
-
"\n" +
|
|
52
|
-
"Fix: delete all but the newest folder under Assets/Samples/MooseRunner/, then re-run.";
|
|
53
|
-
Debug.LogError(msg);
|
|
54
|
-
throw new InvalidOperationException(msg);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
1
|
+
using System;
|
|
2
|
+
using System.IO;
|
|
3
|
+
using System.Linq;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
namespace MooseRunner.Internal.Tests
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
/// Detects duplicate MooseRunner sample-version folders in Assets/Samples/.
|
|
10
|
+
/// Unity's UPM Sample import creates a new <c>Assets/Samples/MooseRunner/<version>/...</c>
|
|
11
|
+
/// folder on every upgrade and never deletes the previous one. The duplicate .cs files
|
|
12
|
+
/// share class FQNs (e.g. <c>MooseRunner.Internal.Tests.Enemy</c>) and stable .meta GUIDs,
|
|
13
|
+
/// which produces a "is not derived from MonoBehaviour or ScriptableObject!" runtime
|
|
14
|
+
/// error when prefabs instantiate. Called from each sample test's OneTimeSetUp so the
|
|
15
|
+
/// check fires only when the customer actually uses the samples.
|
|
16
|
+
/// </summary>
|
|
17
|
+
public static class MooseRunnerSampleVersionCheck
|
|
18
|
+
{
|
|
19
|
+
private static bool _alreadyChecked;
|
|
20
|
+
private const string SamplesRoot = "Assets/Samples/MooseRunner";
|
|
21
|
+
|
|
22
|
+
/// <summary>
|
|
23
|
+
/// Throws <see cref="InvalidOperationException"/> if multiple MooseRunner sample-version
|
|
24
|
+
/// folders are present. First call performs the scan; subsequent calls within the same
|
|
25
|
+
/// domain are no-ops (the flag resets on domain reload, which is fine — the check is
|
|
26
|
+
/// idempotent and cheap).
|
|
27
|
+
/// </summary>
|
|
28
|
+
public static void EnsureSingleVersion()
|
|
29
|
+
{
|
|
30
|
+
if (_alreadyChecked) return;
|
|
31
|
+
_alreadyChecked = true;
|
|
32
|
+
|
|
33
|
+
if (!Directory.Exists(SamplesRoot)) return;
|
|
34
|
+
|
|
35
|
+
var versionDirs = Directory.GetDirectories(SamplesRoot);
|
|
36
|
+
if (versionDirs.Length <= 1) return;
|
|
37
|
+
|
|
38
|
+
var sortedFolders = versionDirs
|
|
39
|
+
.Select(Path.GetFileName)
|
|
40
|
+
.OrderBy(n => n)
|
|
41
|
+
.Select(n => " " + SamplesRoot + "/" + n);
|
|
42
|
+
|
|
43
|
+
string msg =
|
|
44
|
+
"Multiple MooseRunner sample versions detected. Unity's UPM 'Reimport Sample' " +
|
|
45
|
+
"creates a new versioned folder on every package upgrade and never deletes the " +
|
|
46
|
+
"previous one. Duplicate .cs files with the same class FQN and stable .meta GUIDs " +
|
|
47
|
+
"produce the runtime error \"... is not derived from MonoBehaviour or ScriptableObject!\" " +
|
|
48
|
+
"when prefabs instantiate.\n" +
|
|
49
|
+
"\n" +
|
|
50
|
+
"Found:\n" + string.Join("\n", sortedFolders) + "\n" +
|
|
51
|
+
"\n" +
|
|
52
|
+
"Fix: delete all but the newest folder under Assets/Samples/MooseRunner/, then re-run.";
|
|
53
|
+
Debug.LogError(msg);
|
|
54
|
+
throw new InvalidOperationException(msg);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
1
|
+
fileFormatVersion: 2
|
|
2
2
|
guid: fb03d23dca7f786428fa1f8e5887bf4b
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
using NUnit.Framework;
|
|
2
|
-
using UnityEngine;
|
|
3
|
-
|
|
4
|
-
namespace MooseRunner.Internal.Tests
|
|
5
|
-
{
|
|
6
|
-
/// <summary>
|
|
7
|
-
/// Tests to verify [Explicit] attribute handling in MooseRunner.
|
|
8
|
-
/// - Normal tests should run in batch mode (class/assembly/root selection)
|
|
9
|
-
/// - [Explicit] tests should only run when directly selected
|
|
10
|
-
/// </summary>
|
|
11
|
-
[TestFixture]
|
|
12
|
-
public class ExplicitAttributeTests
|
|
13
|
-
{
|
|
14
|
-
[Test]
|
|
15
|
-
public void NormalTest_ShouldAlwaysRun()
|
|
16
|
-
{
|
|
17
|
-
Debug.Log("NormalTest_ShouldAlwaysRun: This test runs in all scenarios.");
|
|
18
|
-
Assert.Pass("Normal test passed");
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
[Test]
|
|
22
|
-
[Explicit("This test should only run when explicitly selected")]
|
|
23
|
-
public void ExplicitTest_ShouldOnlyRunWhenDirectlySelected()
|
|
24
|
-
{
|
|
25
|
-
Debug.Log("ExplicitTest_ShouldOnlyRunWhenDirectlySelected: This test should only run when directly selected.");
|
|
26
|
-
Assert.Pass("Explicit test passed - this means it was directly selected");
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
[Test]
|
|
30
|
-
public void AnotherNormalTest_ShouldAlwaysRun()
|
|
31
|
-
{
|
|
32
|
-
Debug.Log("AnotherNormalTest_ShouldAlwaysRun: This is another normal test.");
|
|
33
|
-
Assert.Pass("Another normal test passed");
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
1
|
+
using NUnit.Framework;
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
|
|
4
|
+
namespace MooseRunner.Internal.Tests
|
|
5
|
+
{
|
|
6
|
+
/// <summary>
|
|
7
|
+
/// Tests to verify [Explicit] attribute handling in MooseRunner.
|
|
8
|
+
/// - Normal tests should run in batch mode (class/assembly/root selection)
|
|
9
|
+
/// - [Explicit] tests should only run when directly selected
|
|
10
|
+
/// </summary>
|
|
11
|
+
[TestFixture]
|
|
12
|
+
public class ExplicitAttributeTests
|
|
13
|
+
{
|
|
14
|
+
[Test]
|
|
15
|
+
public void NormalTest_ShouldAlwaysRun()
|
|
16
|
+
{
|
|
17
|
+
Debug.Log("NormalTest_ShouldAlwaysRun: This test runs in all scenarios.");
|
|
18
|
+
Assert.Pass("Normal test passed");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[Test]
|
|
22
|
+
[Explicit("This test should only run when explicitly selected")]
|
|
23
|
+
public void ExplicitTest_ShouldOnlyRunWhenDirectlySelected()
|
|
24
|
+
{
|
|
25
|
+
Debug.Log("ExplicitTest_ShouldOnlyRunWhenDirectlySelected: This test should only run when directly selected.");
|
|
26
|
+
Assert.Pass("Explicit test passed - this means it was directly selected");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[Test]
|
|
30
|
+
public void AnotherNormalTest_ShouldAlwaysRun()
|
|
31
|
+
{
|
|
32
|
+
Debug.Log("AnotherNormalTest_ShouldAlwaysRun: This is another normal test.");
|
|
33
|
+
Assert.Pass("Another normal test passed");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
using System;
|
|
2
|
-
using System.Collections;
|
|
3
|
-
using System.Collections.Generic;
|
|
4
|
-
using NUnit.Framework;
|
|
5
|
-
using UnityEngine;
|
|
6
|
-
using UnityEngine.TestTools;
|
|
7
|
-
|
|
8
|
-
namespace MooseRunner.Internal.Tests
|
|
9
|
-
{
|
|
10
|
-
/// <summary>
|
|
11
|
-
/// Test class to verify that OneTimeSetUp and OneTimeTearDown methods get fresh instances
|
|
12
|
-
/// while regular test methods (SetUp/Test/TearDown) share the same instance within a test cycle.
|
|
13
|
-
/// Uses _instanceId with default value 99 to track instance persistence.
|
|
14
|
-
/// </summary>
|
|
15
|
-
public class InstanceHandlingVerificationTest
|
|
16
|
-
{
|
|
17
|
-
|
|
18
|
-
// Instance identifier - defaults to 99, each method should verify the expected previous value
|
|
19
|
-
private int _instanceId = 99;
|
|
20
|
-
|
|
21
|
-
// Constructor called when creating a new instance
|
|
22
|
-
public InstanceHandlingVerificationTest()
|
|
23
|
-
{
|
|
24
|
-
Debug.Log($"Constructor called, _instanceId set to {_instanceId}");
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
[OneTimeSetUp]
|
|
28
|
-
public void OneTimeSetUpMethod()
|
|
29
|
-
{
|
|
30
|
-
MooseRunnerSampleVersionCheck.EnsureSingleVersion();
|
|
31
|
-
// OneTimeSetUp should get a fresh instance, so _instanceId should be 99 (default)
|
|
32
|
-
Assert.AreEqual(99, _instanceId, "OneTimeSetUp should start with default _instanceId = 99 (fresh instance)");
|
|
33
|
-
|
|
34
|
-
_instanceId = 100; // Set to new value
|
|
35
|
-
Debug.Log($"OneTimeSetUp: verified _instanceId was 99, changed to {_instanceId}");
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
[SetUp]
|
|
39
|
-
public void SetUpMethod()
|
|
40
|
-
{
|
|
41
|
-
// SetUp should get a fresh instance for each test, so _instanceId should be 99 (default)
|
|
42
|
-
Assert.AreEqual(99, _instanceId, "SetUp should start with default _instanceId = 99 (fresh instance for each test)");
|
|
43
|
-
|
|
44
|
-
_instanceId = 200; // Set to new value for test methods to verify
|
|
45
|
-
Debug.Log($"SetUp: verified _instanceId was 99, changed to {_instanceId}");
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
[Test]
|
|
49
|
-
public void FirstTest()
|
|
50
|
-
{
|
|
51
|
-
// Test should use same instance as SetUp, so _instanceId should be 200
|
|
52
|
-
Assert.AreEqual(200, _instanceId, "FirstTest should see _instanceId = 200 from SetUp (same instance)");
|
|
53
|
-
|
|
54
|
-
_instanceId = 300; // Change for TearDown to verify
|
|
55
|
-
Debug.Log($"FirstTest: verified _instanceId was 200, changed to {_instanceId}");
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
[Test]
|
|
59
|
-
public void SecondTest()
|
|
60
|
-
{
|
|
61
|
-
// Test should use same instance as SetUp, so _instanceId should be 200
|
|
62
|
-
Assert.AreEqual(200, _instanceId, "SecondTest should see _instanceId = 200 from SetUp (same instance)");
|
|
63
|
-
|
|
64
|
-
_instanceId = 400; // Change for TearDown to verify
|
|
65
|
-
Debug.Log($"SecondTest: verified _instanceId was 200, changed to {_instanceId}");
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
[UnityTest]
|
|
69
|
-
public IEnumerator CoroutineTest()
|
|
70
|
-
{
|
|
71
|
-
// Test should use same instance as SetUp, so _instanceId should be 200
|
|
72
|
-
Assert.AreEqual(200, _instanceId, "CoroutineTest should see _instanceId = 200 from SetUp (same instance)");
|
|
73
|
-
|
|
74
|
-
_instanceId = 500; // Change for TearDown to verify
|
|
75
|
-
Debug.Log($"CoroutineTest: verified _instanceId was 200, changed to {_instanceId}");
|
|
76
|
-
yield return new WaitForSeconds(0.1f);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
[TearDown]
|
|
80
|
-
public void TearDownMethod()
|
|
81
|
-
{
|
|
82
|
-
// TearDown should use same instance as the test method, so _instanceId should be what the test set
|
|
83
|
-
// (300 for FirstTest, 400 for SecondTest, 500 for CoroutineTest)
|
|
84
|
-
Assert.IsTrue(_instanceId == 300 || _instanceId == 400 || _instanceId == 500,
|
|
85
|
-
$"TearDown should see _instanceId from test method (300, 400, or 500), but got {_instanceId}");
|
|
86
|
-
|
|
87
|
-
Debug.Log($"TearDown: verified _instanceId was {_instanceId} (from test method - same instance)");
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
[OneTimeTearDown]
|
|
91
|
-
public void OneTimeTearDownMethod()
|
|
92
|
-
{
|
|
93
|
-
// OneTimeTearDown should get a fresh instance, so _instanceId should be 99 (default)
|
|
94
|
-
Assert.AreEqual(99, _instanceId, "OneTimeTearDown should start with default _instanceId = 99 (fresh instance)");
|
|
95
|
-
|
|
96
|
-
Debug.Log($"OneTimeTearDown: verified _instanceId was 99 (fresh instance)");
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
}
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections;
|
|
3
|
+
using System.Collections.Generic;
|
|
4
|
+
using NUnit.Framework;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
using UnityEngine.TestTools;
|
|
7
|
+
|
|
8
|
+
namespace MooseRunner.Internal.Tests
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
/// Test class to verify that OneTimeSetUp and OneTimeTearDown methods get fresh instances
|
|
12
|
+
/// while regular test methods (SetUp/Test/TearDown) share the same instance within a test cycle.
|
|
13
|
+
/// Uses _instanceId with default value 99 to track instance persistence.
|
|
14
|
+
/// </summary>
|
|
15
|
+
public class InstanceHandlingVerificationTest
|
|
16
|
+
{
|
|
17
|
+
|
|
18
|
+
// Instance identifier - defaults to 99, each method should verify the expected previous value
|
|
19
|
+
private int _instanceId = 99;
|
|
20
|
+
|
|
21
|
+
// Constructor called when creating a new instance
|
|
22
|
+
public InstanceHandlingVerificationTest()
|
|
23
|
+
{
|
|
24
|
+
Debug.Log($"Constructor called, _instanceId set to {_instanceId}");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[OneTimeSetUp]
|
|
28
|
+
public void OneTimeSetUpMethod()
|
|
29
|
+
{
|
|
30
|
+
MooseRunnerSampleVersionCheck.EnsureSingleVersion();
|
|
31
|
+
// OneTimeSetUp should get a fresh instance, so _instanceId should be 99 (default)
|
|
32
|
+
Assert.AreEqual(99, _instanceId, "OneTimeSetUp should start with default _instanceId = 99 (fresh instance)");
|
|
33
|
+
|
|
34
|
+
_instanceId = 100; // Set to new value
|
|
35
|
+
Debug.Log($"OneTimeSetUp: verified _instanceId was 99, changed to {_instanceId}");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
[SetUp]
|
|
39
|
+
public void SetUpMethod()
|
|
40
|
+
{
|
|
41
|
+
// SetUp should get a fresh instance for each test, so _instanceId should be 99 (default)
|
|
42
|
+
Assert.AreEqual(99, _instanceId, "SetUp should start with default _instanceId = 99 (fresh instance for each test)");
|
|
43
|
+
|
|
44
|
+
_instanceId = 200; // Set to new value for test methods to verify
|
|
45
|
+
Debug.Log($"SetUp: verified _instanceId was 99, changed to {_instanceId}");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[Test]
|
|
49
|
+
public void FirstTest()
|
|
50
|
+
{
|
|
51
|
+
// Test should use same instance as SetUp, so _instanceId should be 200
|
|
52
|
+
Assert.AreEqual(200, _instanceId, "FirstTest should see _instanceId = 200 from SetUp (same instance)");
|
|
53
|
+
|
|
54
|
+
_instanceId = 300; // Change for TearDown to verify
|
|
55
|
+
Debug.Log($"FirstTest: verified _instanceId was 200, changed to {_instanceId}");
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
[Test]
|
|
59
|
+
public void SecondTest()
|
|
60
|
+
{
|
|
61
|
+
// Test should use same instance as SetUp, so _instanceId should be 200
|
|
62
|
+
Assert.AreEqual(200, _instanceId, "SecondTest should see _instanceId = 200 from SetUp (same instance)");
|
|
63
|
+
|
|
64
|
+
_instanceId = 400; // Change for TearDown to verify
|
|
65
|
+
Debug.Log($"SecondTest: verified _instanceId was 200, changed to {_instanceId}");
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
[UnityTest]
|
|
69
|
+
public IEnumerator CoroutineTest()
|
|
70
|
+
{
|
|
71
|
+
// Test should use same instance as SetUp, so _instanceId should be 200
|
|
72
|
+
Assert.AreEqual(200, _instanceId, "CoroutineTest should see _instanceId = 200 from SetUp (same instance)");
|
|
73
|
+
|
|
74
|
+
_instanceId = 500; // Change for TearDown to verify
|
|
75
|
+
Debug.Log($"CoroutineTest: verified _instanceId was 200, changed to {_instanceId}");
|
|
76
|
+
yield return new WaitForSeconds(0.1f);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[TearDown]
|
|
80
|
+
public void TearDownMethod()
|
|
81
|
+
{
|
|
82
|
+
// TearDown should use same instance as the test method, so _instanceId should be what the test set
|
|
83
|
+
// (300 for FirstTest, 400 for SecondTest, 500 for CoroutineTest)
|
|
84
|
+
Assert.IsTrue(_instanceId == 300 || _instanceId == 400 || _instanceId == 500,
|
|
85
|
+
$"TearDown should see _instanceId from test method (300, 400, or 500), but got {_instanceId}");
|
|
86
|
+
|
|
87
|
+
Debug.Log($"TearDown: verified _instanceId was {_instanceId} (from test method - same instance)");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
[OneTimeTearDown]
|
|
91
|
+
public void OneTimeTearDownMethod()
|
|
92
|
+
{
|
|
93
|
+
// OneTimeTearDown should get a fresh instance, so _instanceId should be 99 (default)
|
|
94
|
+
Assert.AreEqual(99, _instanceId, "OneTimeTearDown should start with default _instanceId = 99 (fresh instance)");
|
|
95
|
+
|
|
96
|
+
Debug.Log($"OneTimeTearDown: verified _instanceId was 99 (fresh instance)");
|
|
97
|
+
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
100
|
}
|
package/Third Party Notices.md
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
# Third Party Notices
|
|
2
|
-
|
|
3
|
-
MooseRunner depends on the following third-party components. Each is
|
|
4
|
-
distributed under its own license, summarized below. The full text of each
|
|
5
|
-
license is available at the linked source.
|
|
6
|
-
|
|
7
|
-
## Customer-installed dependencies
|
|
8
|
-
|
|
9
|
-
These are declared as UPM `dependencies` in `package.json` and installed by
|
|
10
|
-
the Package Manager into the customer's project. We do not redistribute
|
|
11
|
-
their binaries.
|
|
12
|
-
|
|
13
|
-
- **Newtonsoft.Json** (`com.unity.nuget.newtonsoft-json`) — MIT License.
|
|
14
|
-
https://github.com/JamesNK/Newtonsoft.Json
|
|
15
|
-
- **UniTask** (`com.cysharp.unitask`) — MIT License.
|
|
16
|
-
https://github.com/Cysharp/UniTask
|
|
17
|
-
|
|
18
|
-
## Optional integrations
|
|
19
|
-
|
|
20
|
-
If the customer has any of the following installed, MooseRunner integrates
|
|
21
|
-
with them. We do not redistribute their binaries.
|
|
22
|
-
|
|
23
|
-
- **Hot Reload for Unity** (`com.singularitygroup.hotreload`) — commercial,
|
|
24
|
-
Singularity Group. https://hotreload.net
|
|
25
|
-
- **Unity Recorder** (`com.unity.recorder`) — Unity Companion License.
|
|
26
|
-
https://docs.unity3d.com/Packages/com.unity.recorder@latest
|
|
27
|
-
- **ParrelSync** (`com.veriorpies.parrelsync`) — MIT License.
|
|
28
|
-
https://github.com/VeriorPies/ParrelSync
|
|
29
|
-
- **MCP-for-Unity** (`com.coplaydev.unity-mcp`) — used only as a defensive
|
|
30
|
-
hook (CloneBootstrapper prevents MCP auto-start in ParrelSync clones).
|
|
31
|
-
https://github.com/CoplayDev/unity-mcp
|
|
32
|
-
|
|
33
|
-
## NUnit
|
|
34
|
-
|
|
35
|
-
Tests use NUnit 3 via Unity's Test Framework
|
|
36
|
-
(`com.unity.test-framework`) — MIT License.
|
|
37
|
-
https://github.com/nunit/nunit
|
|
1
|
+
# Third Party Notices
|
|
2
|
+
|
|
3
|
+
MooseRunner depends on the following third-party components. Each is
|
|
4
|
+
distributed under its own license, summarized below. The full text of each
|
|
5
|
+
license is available at the linked source.
|
|
6
|
+
|
|
7
|
+
## Customer-installed dependencies
|
|
8
|
+
|
|
9
|
+
These are declared as UPM `dependencies` in `package.json` and installed by
|
|
10
|
+
the Package Manager into the customer's project. We do not redistribute
|
|
11
|
+
their binaries.
|
|
12
|
+
|
|
13
|
+
- **Newtonsoft.Json** (`com.unity.nuget.newtonsoft-json`) — MIT License.
|
|
14
|
+
https://github.com/JamesNK/Newtonsoft.Json
|
|
15
|
+
- **UniTask** (`com.cysharp.unitask`) — MIT License.
|
|
16
|
+
https://github.com/Cysharp/UniTask
|
|
17
|
+
|
|
18
|
+
## Optional integrations
|
|
19
|
+
|
|
20
|
+
If the customer has any of the following installed, MooseRunner integrates
|
|
21
|
+
with them. We do not redistribute their binaries.
|
|
22
|
+
|
|
23
|
+
- **Hot Reload for Unity** (`com.singularitygroup.hotreload`) — commercial,
|
|
24
|
+
Singularity Group. https://hotreload.net
|
|
25
|
+
- **Unity Recorder** (`com.unity.recorder`) — Unity Companion License.
|
|
26
|
+
https://docs.unity3d.com/Packages/com.unity.recorder@latest
|
|
27
|
+
- **ParrelSync** (`com.veriorpies.parrelsync`) — MIT License.
|
|
28
|
+
https://github.com/VeriorPies/ParrelSync
|
|
29
|
+
- **MCP-for-Unity** (`com.coplaydev.unity-mcp`) — used only as a defensive
|
|
30
|
+
hook (CloneBootstrapper prevents MCP auto-start in ParrelSync clones).
|
|
31
|
+
https://github.com/CoplayDev/unity-mcp
|
|
32
|
+
|
|
33
|
+
## NUnit
|
|
34
|
+
|
|
35
|
+
Tests use NUnit 3 via Unity's Test Framework
|
|
36
|
+
(`com.unity.test-framework`) — MIT License.
|
|
37
|
+
https://github.com/nunit/nunit
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "com.valectric.mooserunner",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.23",
|
|
4
4
|
"displayName": "MooseRunner",
|
|
5
5
|
"description": "MooseRunner boosts PlayMode testing with Hot Reload, MCP for AIs, timescale control, and Task support. It enables rapid iteration, auto test reruns, full documentation and dedicated support.",
|
|
6
6
|
"unity": "6000.2",
|