diff --git a/Assets/APIExamples/Tests/Editor/APIExamples.Editor.Tests.asmdef b/Assets/APIExamples/Tests/Editor/APIExamples.Editor.Tests.asmdef index bfbd6f9..bd148d2 100644 --- a/Assets/APIExamples/Tests/Editor/APIExamples.Editor.Tests.asmdef +++ b/Assets/APIExamples/Tests/Editor/APIExamples.Editor.Tests.asmdef @@ -6,8 +6,7 @@ "UnityEditor.TestRunner", "APIExamples.Tests", "UniTask", - "TestHelper", - "NUnit.Analyzers_Unity" + "TestHelper" ], "includePlatforms": [ "Editor" diff --git a/Assets/APIExamples/Tests/Editor/UnityTestFramework/UnityTestFrameworkVersionCheck.cs b/Assets/APIExamples/Tests/Editor/UnityTestFramework/UnityTestFrameworkVersionCheck.cs index aaf4283..a180baa 100644 --- a/Assets/APIExamples/Tests/Editor/UnityTestFramework/UnityTestFrameworkVersionCheck.cs +++ b/Assets/APIExamples/Tests/Editor/UnityTestFramework/UnityTestFrameworkVersionCheck.cs @@ -11,6 +11,7 @@ namespace APIExamples.Editor.UnityTestFramework { [TestFixture] + [Timeout(10000)] public class UnityTestFrameworkVersionCheck { private static async UniTask GetTestFrameworkPackageVersionAsync() diff --git a/Assets/APIExamples/Tests/Runtime/APIExamples.Tests.asmdef b/Assets/APIExamples/Tests/Runtime/APIExamples.Tests.asmdef index d65dd80..132af17 100644 --- a/Assets/APIExamples/Tests/Runtime/APIExamples.Tests.asmdef +++ b/Assets/APIExamples/Tests/Runtime/APIExamples.Tests.asmdef @@ -6,8 +6,7 @@ "UnityEditor.TestRunner", "APIExamples", "UniTask", - "TestHelper", - "NUnit.Analyzers_Unity" + "TestHelper" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/APIExamples/Tests/Runtime/NUnit/ConstraintExample.cs b/Assets/APIExamples/Tests/Runtime/NUnit/ConstraintExample.cs index 0c22159..655f8ad 100644 --- a/Assets/APIExamples/Tests/Runtime/NUnit/ConstraintExample.cs +++ b/Assets/APIExamples/Tests/Runtime/NUnit/ConstraintExample.cs @@ -575,6 +575,7 @@ public class ファイルとディレクトリ } [Test] + [UnityPlatform(RuntimePlatform.OSXEditor, RuntimePlatform.WindowsEditor, RuntimePlatform.LinuxEditor)] public void HasLength_ファイルのサイズを検証() { var dir = Path.Combine( @@ -849,8 +850,10 @@ async Task GetThrowWithMessageAsync() throw new ArgumentException("message!"); } +#pragma warning disable UTF2002 // Ignore属性で除外した、使用できないことを示す例のため Assert.That(async () => await GetThrowWithMessageAsync(), Throws.TypeOf().And.Message.EqualTo("message!")); +#pragma warning restore UTF2002 // Note: 非同期(async)メソッドに対してThrows制約が使用できない // See: https://unity3d.atlassian.net/servicedesk/customer/portal/2/IN-28107 } @@ -865,7 +868,9 @@ async Task GetThrowWithMessageAsync() throw new ArgumentException("message!"); } +#pragma warning disable UTF2001 // Ignore属性で除外した、使用できないことを示す例のため Assert.ThrowsAsync(async () => await GetThrowWithMessageAsync()); +#pragma warning restore UTF2001 // Note: 非同期(async)メソッドに対してThrowsAsyncも使用できない // Note: クラシックモデルではMessage文字列の評価はできない } @@ -908,6 +913,7 @@ public class 属性とプロパティ } [Test] + [UnityPlatform(RuntimePlatform.OSXEditor, RuntimePlatform.WindowsEditor, RuntimePlatform.LinuxEditor)] // Has.Propertyはリフレクションでプロパティを参照し、プレイヤーではマネージドコードストリッピングで削除され得るため public void PropertyExistsConstraint_プロパティを持っていること() { var actual = new 属性とプロパティ(); @@ -919,6 +925,7 @@ public class 属性とプロパティ } [Test] + [UnityPlatform(RuntimePlatform.OSXEditor, RuntimePlatform.WindowsEditor, RuntimePlatform.LinuxEditor)] // Has.Propertyはリフレクションでプロパティを参照し、プレイヤーではマネージドコードストリッピングで削除され得るため public void PropertyConstraint_プロパティの値が正しい() { var actual = new 属性とプロパティ(); @@ -1015,7 +1022,9 @@ public class 遅延 { var start = Time.realtimeSinceStartup; // Note: 非同期ではなく同一フレームで遅延処理されるため Time.time は変化しません +#pragma warning disable UTF2005 // realtimeSinceStartupは同一フレーム内でも進むため、DelayedConstraintでも条件が変化する Assert.That(() => Time.realtimeSinceStartup, Is.GreaterThan(start + 0.2f).After(500)); +#pragma warning restore UTF2005 // 失敗時メッセージ例: // Expected: greater than 2.33228302f after 2500 millisecond delay // But was: 0.33228299f diff --git a/Assets/APIExamples/Tests/Runtime/NUnit/MaxTimeAttributeExample.cs b/Assets/APIExamples/Tests/Runtime/NUnit/MaxTimeAttributeExample.cs index 1558af4..1a6f29d 100644 --- a/Assets/APIExamples/Tests/Runtime/NUnit/MaxTimeAttributeExample.cs +++ b/Assets/APIExamples/Tests/Runtime/NUnit/MaxTimeAttributeExample.cs @@ -26,9 +26,11 @@ public class MaxTimeAttributeExample public void MaxTime属性_指定ミリ秒よりも時間のかかるテストは実行後に失敗() { var endTime = DateTime.Now.AddMilliseconds(200); +#pragma warning disable UTF4003 // 同期テストでMaxTime属性の制限時間を超えさせる例のため、yieldもawaitもせずに待つ while (DateTime.Now < endTime) { } +#pragma warning restore UTF4003 } [UnityTest] diff --git a/Assets/APIExamples/Tests/Runtime/NUnit/OrderAttributeExample.cs b/Assets/APIExamples/Tests/Runtime/NUnit/OrderAttributeExample.cs index 3c1f37c..865c2f7 100644 --- a/Assets/APIExamples/Tests/Runtime/NUnit/OrderAttributeExample.cs +++ b/Assets/APIExamples/Tests/Runtime/NUnit/OrderAttributeExample.cs @@ -17,7 +17,7 @@ namespace APIExamples.NUnit [TestFixture] public class OrderAttributeExample { - private static int s_count = 0; + private static int s_count; [Test] [Order(2)] diff --git a/Assets/APIExamples/Tests/Runtime/NUnit/TimeoutAttributeExample.cs b/Assets/APIExamples/Tests/Runtime/NUnit/TimeoutAttributeExample.cs index fe27e9e..a5b7676 100644 --- a/Assets/APIExamples/Tests/Runtime/NUnit/TimeoutAttributeExample.cs +++ b/Assets/APIExamples/Tests/Runtime/NUnit/TimeoutAttributeExample.cs @@ -30,9 +30,11 @@ public class TimeoutAttributeExample public void Timeout属性_同期テストではタイムアウトで割り込みは発生しないが終了時に指定時間を超えていたらテスト失敗() { var endTime = DateTime.Now.AddSeconds(0.5d); +#pragma warning disable UTF4003 // 同期テストでTimeout属性の制限時間を超えさせる例のため、yieldもawaitもせずに待つ while (DateTime.Now < endTime) { } +#pragma warning restore UTF4003 } [UnityTest] diff --git a/Assets/APIExamples/Tests/Runtime/UnityTestFramework/AllocatingGcMemoryExample.cs b/Assets/APIExamples/Tests/Runtime/UnityTestFramework/AllocatingGcMemoryExample.cs index 5736210..a43d763 100644 --- a/Assets/APIExamples/Tests/Runtime/UnityTestFramework/AllocatingGcMemoryExample.cs +++ b/Assets/APIExamples/Tests/Runtime/UnityTestFramework/AllocatingGcMemoryExample.cs @@ -44,7 +44,7 @@ void UsePrimitives() void UseString() { var s = "string"; - s += s; + _ = s + s; } Assert.That(UseString, Is.AllocatingGCMemory()); @@ -68,7 +68,7 @@ void UseLogger() { void UseColor() { - var c = new Color(1f, 0f, 0f, 1f); + _ = new Color(1f, 0f, 0f, 1f); } Assert.That(UseColor, Is.Not.AllocatingGCMemory()); @@ -88,7 +88,9 @@ async Task UsePrimitives() } } +#pragma warning disable UTF2003 // Ignore属性で除外した、asyncメソッドでは期待どおり動作しないことを示す例のため Assert.That(async () => await UsePrimitives(), Is.Not.AllocatingGCMemory()); +#pragma warning restore UTF2003 } [Explicit("Is.AllocatingGCMemory()をasyncメソッドに使用しても常に成功してしまう(Unity Test Framework v1.6.0時点)")] @@ -99,10 +101,12 @@ async Task UseString() { await Task.Yield(); var s = "string"; - s += s; + _ = s + s; } +#pragma warning disable UTF2003 // Explicit属性で除外した、asyncメソッドでは期待どおり動作しないことを示す例のため Assert.That(async () => await UseString(), Is.AllocatingGCMemory()); +#pragma warning restore UTF2003 } } } diff --git a/Assets/APIExamples/Tests/Runtime/UnityTestFramework/LogAssertExample.cs b/Assets/APIExamples/Tests/Runtime/UnityTestFramework/LogAssertExample.cs index a38b88f..9de499e 100644 --- a/Assets/APIExamples/Tests/Runtime/UnityTestFramework/LogAssertExample.cs +++ b/Assets/APIExamples/Tests/Runtime/UnityTestFramework/LogAssertExample.cs @@ -9,6 +9,7 @@ using UnityEngine.TestTools; // ReSharper disable ConditionIsAlwaysTrueOrFalse +// ReSharper disable HeuristicUnreachableCode #pragma warning disable 162 namespace APIExamples.UnityTestFramework @@ -94,6 +95,7 @@ public class LogAssertExample } [UnityTest] + [Timeout(1000)] public IEnumerator Expect_非同期テストで先に記述_Yieldを挟んでも同一フレームなら有効_UnityTest() { LogAssert.Expect(LogType.Error, "expected message"); @@ -143,6 +145,7 @@ public class LogAssertExample } [UnityTest] + [Timeout(1000)] public IEnumerator Expect_非同期テストでもログメッセージは複数フレーム有効_UnityTest() { Debug.Log("expected message"); diff --git a/Assets/BasicExample/Scripts/Runtime/Entities/Enums/PassiveEffectState.cs b/Assets/BasicExample/Scripts/Runtime/Entities/Enums/PassiveEffectState.cs index 93dc8c8..74777ee 100644 --- a/Assets/BasicExample/Scripts/Runtime/Entities/Enums/PassiveEffectState.cs +++ b/Assets/BasicExample/Scripts/Runtime/Entities/Enums/PassiveEffectState.cs @@ -5,8 +5,8 @@ namespace BasicExample.Entities.Enums { public enum PassiveEffectState { - Normal, // 通常 + Normal, // 通常 Strengthening, // 強化 - Weakening, // 弱体 + Weakening, // 弱体 } } diff --git a/Assets/BasicExample/Tests/Editor/BasicExample.Editor.Tests.asmdef b/Assets/BasicExample/Tests/Editor/BasicExample.Editor.Tests.asmdef index fdc26ab..86a31e8 100644 --- a/Assets/BasicExample/Tests/Editor/BasicExample.Editor.Tests.asmdef +++ b/Assets/BasicExample/Tests/Editor/BasicExample.Editor.Tests.asmdef @@ -5,9 +5,8 @@ "UnityEngine.TestRunner", "UnityEditor.TestRunner", "BasicExample.Editor", - "BasicExample", - "BasicExample.Tests", - "NUnit.Analyzers_Unity" + "BasicExample", + "BasicExample.Tests" ], "includePlatforms": [ "Editor" diff --git a/Assets/BasicExample/Tests/Editor/Validators/PrefabValidator.cs b/Assets/BasicExample/Tests/Editor/Validators/PrefabValidator.cs index 5c4eba6..1d45420 100644 --- a/Assets/BasicExample/Tests/Editor/Validators/PrefabValidator.cs +++ b/Assets/BasicExample/Tests/Editor/Validators/PrefabValidator.cs @@ -20,7 +20,7 @@ namespace BasicExample.Editor.Validators public class PrefabValidator { private static IEnumerable Prefabs => AssetDatabase - .FindAssets("t:Prefab", new string[] { "Assets/" }) + .FindAssets("t:Prefab", new[] { "Assets/" }) .Select(AssetDatabase.GUIDToAssetPath) .Select(path => new TestCaseData(path).SetName(Path.GetFileName(path))); diff --git a/Assets/BasicExample/Tests/Editor/Validators/SceneValidator.cs b/Assets/BasicExample/Tests/Editor/Validators/SceneValidator.cs index 07fc90e..5ccf19d 100644 --- a/Assets/BasicExample/Tests/Editor/Validators/SceneValidator.cs +++ b/Assets/BasicExample/Tests/Editor/Validators/SceneValidator.cs @@ -21,7 +21,7 @@ namespace BasicExample.Editor.Validators public class SceneValidator { private static IEnumerable Scenes => AssetDatabase - .FindAssets("t:SceneAsset", new string[] { "Assets/" }) + .FindAssets("t:SceneAsset", new[] { "Assets/" }) .Select(AssetDatabase.GUIDToAssetPath) .Select(path => new TestCaseData(path).SetName(Path.GetFileName(path))); diff --git a/Assets/BasicExample/Tests/Runtime/BasicExample.Tests.asmdef b/Assets/BasicExample/Tests/Runtime/BasicExample.Tests.asmdef index af9a3ac..b851110 100644 --- a/Assets/BasicExample/Tests/Runtime/BasicExample.Tests.asmdef +++ b/Assets/BasicExample/Tests/Runtime/BasicExample.Tests.asmdef @@ -4,9 +4,8 @@ "references": [ "UnityEngine.TestRunner", "UnityEditor.TestRunner", - "BasicExample", - "TestHelper", - "NUnit.Analyzers_Unity" + "BasicExample", + "TestHelper" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/BasicExample/Tests/Runtime/Entities/CharacterStatusTest.cs b/Assets/BasicExample/Tests/Runtime/Entities/CharacterStatusTest.cs index 68a2ac1..d3cbe72 100644 --- a/Assets/BasicExample/Tests/Runtime/Entities/CharacterStatusTest.cs +++ b/Assets/BasicExample/Tests/Runtime/Entities/CharacterStatusTest.cs @@ -31,7 +31,7 @@ public class CharacterStatusTest public void TakeDamage_防御力3に対して攻撃力1_ダメージなし() { // Setup - var sut = new CharacterStatus(Element.None, defense: 3); + var sut = new CharacterStatus(defense: 3); // Exercise var damage = sut.TakeDamage(Element.None, attack: 1); @@ -45,7 +45,7 @@ public class CharacterStatusTest { // Setup var beforeHp = 100; - var sut = new CharacterStatus(Element.None, defense: 3, hp: beforeHp); + var sut = new CharacterStatus(defense: 3, hp: beforeHp); // Exercise sut.TakeDamage(Element.None, attack: 1); @@ -58,7 +58,7 @@ public class CharacterStatusTest [Test] public void TakeDamage_防御力0に対して攻撃力1_ダメージあり() { - var sut = new CharacterStatus(Element.None, defense: 0); + var sut = new CharacterStatus(defense: 0); var damage = sut.TakeDamage(Element.None, attack: 1); @@ -69,7 +69,7 @@ public class CharacterStatusTest public void TakeDamage_防御力2に対して攻撃力3_HPが1減少() { var beforeHp = 100; - var sut = new CharacterStatus(Element.None, defense: 2, hp: beforeHp); + var sut = new CharacterStatus(defense: 2, hp: beforeHp); sut.TakeDamage(Element.None, attack: 3); @@ -82,7 +82,7 @@ public class CharacterStatusTest public void TakeDamage_防御力より攻撃力が大きい_HPが差分だけ減少(int defence, int attackPower, int expected) { var beforeHp = 100; - var sut = new CharacterStatus(Element.None, defense: defence, hp: beforeHp); + var sut = new CharacterStatus(defense: defence, hp: beforeHp); sut.TakeDamage(Element.None, attack: attackPower); diff --git a/Assets/BasicExample/Tests/Runtime/Entities/Settings/HitPointGaugeSettingTest.cs b/Assets/BasicExample/Tests/Runtime/Entities/Settings/HitPointGaugeSettingTest.cs index e7a6e6d..76a83c0 100644 --- a/Assets/BasicExample/Tests/Runtime/Entities/Settings/HitPointGaugeSettingTest.cs +++ b/Assets/BasicExample/Tests/Runtime/Entities/Settings/HitPointGaugeSettingTest.cs @@ -25,7 +25,7 @@ public class 同値分割法に基づいたテスト public void GetHitPointGaugeColor_HP残量に対する表示色は正しい(float percentage, Color expected) { var sut = ScriptableObject.CreateInstance(); - var actual = sut.GetHitPointGaugeColor(percentage, false); + var actual = sut.GetHitPointGaugeColor(percentage); Assert.That(actual, Is.EqualTo(expected).Using(ColorEqualityComparer.Instance)); } @@ -49,7 +49,7 @@ public class 境界値分析に基づいたテスト public void GetHitPointGaugeColor_HP残量に対する表示色は正しい(float percentage, Color expected) { var sut = ScriptableObject.CreateInstance(); - var actual = sut.GetHitPointGaugeColor(percentage, false); + var actual = sut.GetHitPointGaugeColor(percentage); Assert.That(actual, Is.EqualTo(expected).Using(ColorEqualityComparer.Instance)); } diff --git a/Assets/Default.globalconfig b/Assets/Default.globalconfig index 32f6583..1f76737 100644 --- a/Assets/Default.globalconfig +++ b/Assets/Default.globalconfig @@ -1,3 +1,13 @@ is_global = true + +# CS0618: Type or member is obsolete dotnet_diagnostic.CS0618.severity = error -dotnet_diagnostic.VSTHRD200.severity = suggestion \ No newline at end of file + +# UTF2006: Property constraints, Ordered.By, and List.Map(...).Property lookup properties that managed code stripping can remove +dotnet_diagnostic.UTF2006.severity = warning + +# UTF4004-UTF4007: Recommendations against fixed-time waits and coroutine-style tests; this project demonstrates those APIs +dotnet_diagnostic.UTF4004.severity = suggestion +dotnet_diagnostic.UTF4005.severity = suggestion +dotnet_diagnostic.UTF4006.severity = suggestion +dotnet_diagnostic.UTF4007.severity = suggestion \ No newline at end of file diff --git a/Assets/InputExample/Scripts/Runtime/FirstPersonControllerLegacy.cs b/Assets/InputExample/Scripts/Runtime/FirstPersonControllerLegacy.cs index 3421a2a..a15cc2d 100644 --- a/Assets/InputExample/Scripts/Runtime/FirstPersonControllerLegacy.cs +++ b/Assets/InputExample/Scripts/Runtime/FirstPersonControllerLegacy.cs @@ -21,7 +21,7 @@ public class FirstPersonControllerLegacy : MonoBehaviour private float rotateSpeed = 30.0f; private const float Gravity = -9.81f; - private float _yVelocity = 0f; + private float _yVelocity; // UnityEngine.Inputの代わりにInputWrapperを使用する internal IInput Input { private get; set; } = new InputWrapper(); diff --git a/Assets/InputSystemExample/Scripts/Runtime/FirstPersonController.cs b/Assets/InputSystemExample/Scripts/Runtime/FirstPersonController.cs index a4d5084..13d11f1 100644 --- a/Assets/InputSystemExample/Scripts/Runtime/FirstPersonController.cs +++ b/Assets/InputSystemExample/Scripts/Runtime/FirstPersonController.cs @@ -23,7 +23,7 @@ public class FirstPersonController : MonoBehaviour private float rotateSpeed = 30.0f; private const float Gravity = -9.81f; - private float _yVelocity = 0f; + private float _yVelocity; private void Awake() { diff --git a/Assets/InputSystemExample/Scripts/Runtime/GoalPlate.cs b/Assets/InputSystemExample/Scripts/Runtime/GoalPlate.cs index 505d233..ec29e7f 100644 --- a/Assets/InputSystemExample/Scripts/Runtime/GoalPlate.cs +++ b/Assets/InputSystemExample/Scripts/Runtime/GoalPlate.cs @@ -8,7 +8,7 @@ namespace InputSystemExample [RequireComponent(typeof(Collider))] public class GoalPlate : MonoBehaviour { - public bool IsGoal { get; private set; } = false; + public bool IsGoal { get; private set; } private void OnTriggerEnter(Collider other) { diff --git a/Assets/InputSystemExample/Tests/Runtime/ScenarioTest.cs b/Assets/InputSystemExample/Tests/Runtime/ScenarioTest.cs index bb2e7a9..b694251 100644 --- a/Assets/InputSystemExample/Tests/Runtime/ScenarioTest.cs +++ b/Assets/InputSystemExample/Tests/Runtime/ScenarioTest.cs @@ -32,6 +32,7 @@ public class ScenarioTest private const string InputTracesPath = "Assets/InputSystemExample/Tests/InputTraces"; [TestCase("Keyboard.inputtrace")] + [Timeout(30000)] public async Task PlaybackTesting_ゴールに到達すること(string path) { // フレームレートをキャプチャ環境に合わせる(Updateで入力を処理しているとき必要) @@ -47,7 +48,7 @@ public class ScenarioTest var isFinished = false; - using (var replayController = eventTrace.Replay() + using (eventTrace.Replay() .OnFinished(() => { isFinished = true; }) // 再生終了したらフラグを立てる .PlayAllEventsAccordingToTimestamps()) { diff --git a/Assets/SceneExample/Tests/Runtime/ResourcesExample.cs b/Assets/SceneExample/Tests/Runtime/ResourcesExample.cs index 3e739c6..33b51c8 100644 --- a/Assets/SceneExample/Tests/Runtime/ResourcesExample.cs +++ b/Assets/SceneExample/Tests/Runtime/ResourcesExample.cs @@ -47,6 +47,8 @@ public void Cleanup() [Test] public void Load_プレイヤー実行でPrefabをロードして使用する例() { + // IPrebuildSetupでビルド時に生成するResourcesのため、プロジェクト上には存在しない + // ReSharper disable once Unity.UnknownResource var prefab = Resources.Load("Prefabs/PrefabExample"); // ビルド時に生成するResourcesからのパス、拡張子なし @@ -59,6 +61,8 @@ public void Cleanup() [Test] public void Load_プレイヤー実行でテキストファイルをロードして使用する例() { + // IPrebuildSetupでビルド時に生成するResourcesのため、プロジェクト上には存在しない + // ReSharper disable once Unity.UnknownResource var text = Resources.Load("TextAssets/TextExample"); // ビルド時に生成するResourcesからのパス、拡張子なし diff --git a/Assets/TestDoubleExample/Scripts/Runtime/Janken/Hand.cs b/Assets/TestDoubleExample/Scripts/Runtime/Janken/Hand.cs index a07eaa4..ded49fd 100644 --- a/Assets/TestDoubleExample/Scripts/Runtime/Janken/Hand.cs +++ b/Assets/TestDoubleExample/Scripts/Runtime/Janken/Hand.cs @@ -7,6 +7,6 @@ public enum Hand { Rock = 0, // ぐー Scissors, // ちょき - Paper // ぱー + Paper // ぱー } } diff --git a/Assets/TestDoubleExample/Tests/Runtime/Janken/NSubstituteJankenTest.cs b/Assets/TestDoubleExample/Tests/Runtime/Janken/NSubstituteJankenTest.cs index a6697f0..3769daf 100644 --- a/Assets/TestDoubleExample/Tests/Runtime/Janken/NSubstituteJankenTest.cs +++ b/Assets/TestDoubleExample/Tests/Runtime/Janken/NSubstituteJankenTest.cs @@ -83,6 +83,8 @@ public class NSubstituteJankenTest spy.Received().Range(0.0f, 1.0f); // 引数 (0f, 1f) で呼ばれたことを検証 spy.DidNotReceive().Range(Arg.Is(x => x != 0.0f), Arg.Any()); // 第一引数は 0f 以外では呼ばれていないことを検証 + // 引数に渡されたリテラル値そのものかを検証するため、誤差を許容しない + // ReSharper disable once CompareOfFloatsByEqualityOperator spy.DidNotReceive().Range(Arg.Any(), Arg.Is(x => x != 1.0f)); // 第二引数は 1f 以外では呼ばれていないことを検証 } } diff --git a/Assets/TestDoubleExample/Tests/Runtime/TestDoubleExample.Tests.asmdef b/Assets/TestDoubleExample/Tests/Runtime/TestDoubleExample.Tests.asmdef index 73e4d45..b14b1c2 100644 --- a/Assets/TestDoubleExample/Tests/Runtime/TestDoubleExample.Tests.asmdef +++ b/Assets/TestDoubleExample/Tests/Runtime/TestDoubleExample.Tests.asmdef @@ -4,9 +4,8 @@ "references": [ "UnityEngine.TestRunner", "UnityEditor.TestRunner", - "TestDoubleExample", - "NUnit.Analyzers_Unity", - "NSubstitute.Analyzers.CSharp_Unity" + "TestDoubleExample", + "NSubstitute.Analyzers.CSharp_Unity" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/UGUIExample/Tests/Runtime/MonkeyTest.cs b/Assets/UGUIExample/Tests/Runtime/MonkeyTest.cs index 601c5f4..a96ddcb 100644 --- a/Assets/UGUIExample/Tests/Runtime/MonkeyTest.cs +++ b/Assets/UGUIExample/Tests/Runtime/MonkeyTest.cs @@ -3,7 +3,6 @@ using System; using System.Threading.Tasks; -using Cysharp.Threading.Tasks; using NUnit.Framework; using TestHelper.Random; using TestHelper.UI; diff --git a/Assets/UGUIExample/Tests/Runtime/UsingEventTriggerTest.cs b/Assets/UGUIExample/Tests/Runtime/UsingEventTriggerTest.cs index 13b5134..0ec69ef 100644 --- a/Assets/UGUIExample/Tests/Runtime/UsingEventTriggerTest.cs +++ b/Assets/UGUIExample/Tests/Runtime/UsingEventTriggerTest.cs @@ -40,16 +40,5 @@ public class UsingEventTriggerTest var eventData = new PointerEventData(EventSystem.current); eventTrigger.OnBeginDrag(eventData); // リスナを登録していないイベント } - - /// - /// GameObjectのワールド座標をスクリーン座標に変換して返す - /// 2D/3D要素専用で、UI要素は考慮していない - /// - /// 操作対象のGameObject - /// スクリーン座標 - private static Vector2 GetScreenPoint(GameObject gameObject) // TODO: Buttonでは使わないが一時的に残しておく - { - return RectTransformUtility.WorldToScreenPoint(Camera.main, gameObject.transform.position); - } } } diff --git a/Assets/link.xml b/Assets/link.xml deleted file mode 100644 index 711a34d..0000000 --- a/Assets/link.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Assets/link.xml.meta b/Assets/link.xml.meta deleted file mode 100644 index 8bc6ca2..0000000 --- a/Assets/link.xml.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 4368dd752a5db48598be1bf3e10444e5 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/manifest.json b/Packages/manifest.json index 7d02c9a..96778f1 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -3,6 +3,7 @@ "com.cysharp.unitask": "2.5.11", "com.nowsprinting.create-script-folders-with-tests": "1.4.0", "com.nowsprinting.local-package-sample": "file:../LocalPackages/com.nowsprinting.local-package-sample", + "com.nowsprinting.test-framework.analyzers": "1.4.2", "com.nowsprinting.test-helper": "1.5.1", "com.nowsprinting.test-helper.input": "1.0.1", "com.nowsprinting.test-helper.random": "1.1.0", @@ -19,7 +20,6 @@ "com.unity.ugui": "2.0.0", "org.nuget.nsubstitute": "5.3.0", "org.nuget.nsubstitute.analyzers.csharp": "1.0.17", - "org.nuget.nunit.analyzers": "3.9.0", "com.unity.modules.accessibility": "1.0.0", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 8831ee5..77c4744 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -26,6 +26,15 @@ "source": "local", "dependencies": {} }, + "com.nowsprinting.test-framework.analyzers": { + "version": "1.4.2", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.4.6" + }, + "url": "https://package.openupm.com" + }, "com.nowsprinting.test-helper": { "version": "1.5.1", "depth": 0, @@ -195,13 +204,6 @@ "dependencies": {}, "url": "https://package.openupm.com" }, - "org.nuget.nunit.analyzers": { - "version": "3.9.0", - "depth": 0, - "source": "registry", - "dependencies": {}, - "url": "https://package.openupm.com" - }, "org.nuget.system.diagnostics.eventlog": { "version": "4.7.0", "depth": 2,