diff --git a/Assets/APIExamples/Tests/Runtime/NUnit/ConstraintExample.cs b/Assets/APIExamples/Tests/Runtime/NUnit/ConstraintExample.cs index decdd8e..7b2616e 100644 --- a/Assets/APIExamples/Tests/Runtime/NUnit/ConstraintExample.cs +++ b/Assets/APIExamples/Tests/Runtime/NUnit/ConstraintExample.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2023 Koji Hasegawa. +// Copyright (c) 2021-2025 Koji Hasegawa. // This software is released under the MIT License. using System; @@ -11,9 +11,6 @@ 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 @@ -315,7 +312,7 @@ public class コレクション [Test] public void HasLength_配列の個数を検証() { - var actual = new int[] { 2, 3, 5, 6 }; + var actual = new[] { 2, 3, 5, 6 }; Assert.That(actual, Has.Length.EqualTo(4)); // 失敗時メッセージ例: // Expected: property Length equal to 4 @@ -539,8 +536,10 @@ public class ファイルとディレクトリ [UnityPlatform(RuntimePlatform.LinuxEditor, RuntimePlatform.WindowsEditor, RuntimePlatform.OSXEditor)] public void EmptyDirectoryConstraint_ディレクトリが空であること() { -#if UNITY_EDITOR - var dir = FileUtil.GetUniqueTempPathInProject(); + var dir = Path.Combine( + Application.temporaryCachePath, + TestContext.CurrentContext.Test.ClassName, + TestContext.CurrentContext.Test.Name); var actual = Directory.CreateDirectory(dir); Assert.That(actual, Is.Empty); @@ -549,15 +548,16 @@ public class ファイルとディレクトリ // But was: Directory.Delete(dir, true); -#endif } [Test] [UnityPlatform(RuntimePlatform.LinuxEditor, RuntimePlatform.WindowsEditor, RuntimePlatform.OSXEditor)] public void FileOrDirectoryExistsConstraint_ファイルまたはディレクトリが存在すること() { -#if UNITY_EDITOR - var dir = Path.GetFileName(FileUtil.GetUniqueTempPathInProject()); + var dir = Path.Combine( + Application.temporaryCachePath, + TestContext.CurrentContext.Test.ClassName, + TestContext.CurrentContext.Test.Name); var directoryInfo = Directory.CreateDirectory(dir); var file = Path.Combine(dir, "test"); var fileInfo = new FileInfo(file); @@ -575,7 +575,6 @@ public class ファイルとディレクトリ // But was: "Temp/UnityTempFile-ac03ee62865a042748c6f54723c2e51b/test" Directory.Delete(dir, true); -#endif } [Test] diff --git a/LICENSE.md b/LICENSE.md index 5ebe940..61fa64f 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021-2023 Koji Hasegawa +Copyright (c) 2021-2025 Koji Hasegawa Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal