diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 995059c..c7117a9 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -42,14 +42,14 @@ jobs: unityVersion: # Available versions see: https://game.ci/docs/docker/versions - 2019.4.40f1 - 2020.3.48f1 - - 2021.3.42f1 - - 2022.3.42f1 + - 2021.3.45f1 + - 2022.3.57f1 - 2023.2.20f1 - - 6000.0.22f1 + - 6000.0.37f1 testMode: - All # run tests in editor include: - - unityVersion: 2023.2.20f1 + - unityVersion: 6000.0.37f1 testMode: Standalone # run tests on player steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b40a4a6..d9aaba5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,16 +43,16 @@ jobs: unityVersion: # Available versions see: https://game.ci/docs/docker/versions - 2019.4.40f1 - 2020.3.48f1 - - 2021.3.42f1 - - 2022.3.42f1 + - 2021.3.45f1 + - 2022.3.57f1 - 2023.2.20f1 - - 6000.0.22f1 + - 6000.0.37f1 testMode: - All # run tests in editor include: - unityVersion: 2019.4.40f1 octocov: true - - unityVersion: 2023.2.20f1 + - unityVersion: 6000.0.37f1 testMode: Standalone # run tests on player steps: diff --git a/Assets/APIExamples/Tests/Runtime/NUnit/ConstraintExample.cs b/Assets/APIExamples/Tests/Runtime/NUnit/ConstraintExample.cs index 52e986c..decdd8e 100644 --- a/Assets/APIExamples/Tests/Runtime/NUnit/ConstraintExample.cs +++ b/Assets/APIExamples/Tests/Runtime/NUnit/ConstraintExample.cs @@ -10,6 +10,10 @@ using NUnit.Framework.Constraints; using UnityEngine; using UnityEngine.TestTools; +using AssertionException = UnityEngine.Assertions.AssertionException; +#if UNITY_EDITOR +using UnityEditor; +#endif #pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously @@ -536,7 +540,7 @@ public class ファイルとディレクトリ public void EmptyDirectoryConstraint_ディレクトリが空であること() { #if UNITY_EDITOR - var dir = UnityEditor.FileUtil.GetUniqueTempPathInProject(); + var dir = FileUtil.GetUniqueTempPathInProject(); var actual = Directory.CreateDirectory(dir); Assert.That(actual, Is.Empty); @@ -553,7 +557,7 @@ public class ファイルとディレクトリ public void FileOrDirectoryExistsConstraint_ファイルまたはディレクトリが存在すること() { #if UNITY_EDITOR - var dir = Path.GetFileName(UnityEditor.FileUtil.GetUniqueTempPathInProject()); + var dir = Path.GetFileName(FileUtil.GetUniqueTempPathInProject()); var directoryInfo = Directory.CreateDirectory(dir); var file = Path.Combine(dir, "test"); var fileInfo = new FileInfo(file); @@ -783,7 +787,7 @@ public class 例外 { void GetAssert() => UnityEngine.Assertions.Assert.IsTrue(false); - Assert.That(() => GetAssert(), Throws.TypeOf()); + Assert.That(() => GetAssert(), Throws.TypeOf()); // 失敗時メッセージ例: // Expected: // But was: @@ -934,6 +938,8 @@ public class XmlSerializableSample public class 破棄されたGameObject { [Test] + [UnityPlatform(RuntimePlatform.OSXEditor, RuntimePlatform.WindowsEditor, RuntimePlatform.LinuxEditor)] + // Note: プレイヤーではnull判定されるため除外 public void Boolキャストオペレーターで破棄されたGameObjectを検証する例() { var cube = new GameObject("Cube"); diff --git a/Assets/APIExamples/Tests/Runtime/NUnit/CustomConstraintExample.cs b/Assets/APIExamples/Tests/Runtime/NUnit/CustomConstraintExample.cs index 70770b9..77e73c5 100644 --- a/Assets/APIExamples/Tests/Runtime/NUnit/CustomConstraintExample.cs +++ b/Assets/APIExamples/Tests/Runtime/NUnit/CustomConstraintExample.cs @@ -36,6 +36,7 @@ private static GameObject CreateDestroyedObject() [Test] [UnityPlatform(RuntimePlatform.OSXEditor, RuntimePlatform.WindowsEditor, RuntimePlatform.LinuxEditor)] + // Note: プレイヤーではnull判定されるため除外 public void CustomConstraint_Extensionsの実装も行なうと可能な書きかた() { var actual = CreateDestroyedObject(); diff --git a/Packages/manifest.json b/Packages/manifest.json index fe6f177..6f8ac7f 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -8,10 +8,10 @@ "com.nowsprinting.test-helper.monkey": "0.5.1", "com.nowsprinting.test-helper.random": "0.2.0", "com.unity.collab-proxy": "1.14.18", - "com.unity.ide.rider": "3.0.26", + "com.unity.ide.rider": "3.0.34", "com.unity.ide.visualstudio": "2.0.22", "com.unity.inputsystem": "1.7.0", - "com.unity.test-framework": "1.4.5", + "com.unity.test-framework": "1.4.6", "com.unity.testframework.graphics": "7.17.0-exp.1", "com.unity.testtools.codecoverage": "1.2.4", "com.unity.textmeshpro": "2.1.6", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index d423236..7423698 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -66,11 +66,11 @@ "depth": 1, "source": "registry", "dependencies": { - "com.unity.scriptablebuildpipeline": "1.17.0", "com.unity.modules.assetbundle": "1.0.0", - "com.unity.modules.imageconversion": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0", "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.scriptablebuildpipeline": "1.17.0", "com.unity.modules.unitywebrequestassetbundle": "1.0.0" }, "url": "https://packages.unity.com" @@ -99,7 +99,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.rider": { - "version": "3.0.26", + "version": "3.0.34", "depth": 0, "source": "registry", "dependencies": { @@ -154,7 +154,7 @@ "url": "https://packages.unity.com" }, "com.unity.test-framework": { - "version": "1.4.5", + "version": "1.4.6", "depth": 0, "source": "registry", "dependencies": { @@ -169,15 +169,15 @@ "depth": 0, "source": "registry", "dependencies": { + "com.unity.modules.vr": "1.0.0", + "com.unity.modules.xr": "1.0.0", + "com.unity.addressables": "1.17.15", "com.unity.xr.management": "4.0.5", - "com.unity.external.test-protocol": "1.0.0-preview", "com.unity.nuget.newtonsoft-json": "2.0.0", "com.unity.xr.legacyinputhelpers": "2.1.8", - "com.unity.modules.xr": "1.0.0", - "com.unity.modules.vr": "1.0.0", - "com.unity.addressables": "1.17.15", - "com.unity.modules.imageconversion": "1.0.0", - "com.unity.testtools.codecoverage": "1.2.0" + "com.unity.external.test-protocol": "1.0.0-preview", + "com.unity.testtools.codecoverage": "1.2.0", + "com.unity.modules.imageconversion": "1.0.0" }, "url": "https://packages.unity.com" }, @@ -205,9 +205,9 @@ "depth": 0, "source": "registry", "dependencies": { + "com.unity.modules.audio": "1.0.0", "com.unity.modules.director": "1.0.0", "com.unity.modules.animation": "1.0.0", - "com.unity.modules.audio": "1.0.0", "com.unity.modules.particlesystem": "1.0.0" }, "url": "https://packages.unity.com" @@ -236,11 +236,11 @@ "depth": 1, "source": "registry", "dependencies": { - "com.unity.modules.subsystems": "1.0.0", "com.unity.modules.vr": "1.0.0", "com.unity.modules.xr": "1.0.0", - "com.unity.xr.legacyinputhelpers": "2.1.7", - "com.unity.subsystemregistration": "1.0.6" + "com.unity.modules.subsystems": "1.0.0", + "com.unity.subsystemregistration": "1.0.6", + "com.unity.xr.legacyinputhelpers": "2.1.7" }, "url": "https://packages.unity.com" },