Skip to content

Commit cba4293

Browse files
committed
Upgrade test-helper packages
1 parent 25b1375 commit cba4293

File tree

5 files changed

+33
-32
lines changed

5 files changed

+33
-32
lines changed

Assets/InputSystemExample/Tests/Runtime/MonkeyTest.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021-2023 Koji Hasegawa.
1+
// Copyright (c) 2021-2025 Koji Hasegawa.
22
// This software is released under the MIT License.
33

44
using System.Diagnostics.CodeAnalysis;
@@ -45,7 +45,7 @@ public void TearDown()
4545
[Test]
4646
public async Task MonkeyTesting()
4747
{
48-
var random = new RandomImpl(); // 擬似乱数生成器
48+
var random = new RandomWrapper(); // 擬似乱数生成器
4949
Debug.Log($"Random that monkey uses: {random}"); // シード値をログ出力(再現可能にするため)
5050

5151
await SceneManager.LoadSceneAsync("InputSystemExample");
@@ -57,8 +57,8 @@ public async Task MonkeyTesting()
5757

5858
using (var tokenSource = new CancellationTokenSource())
5959
{
60-
PressKeys(new RandomImpl(random.Next()), tokenSource.Token).Forget();
61-
MoveMouse(new RandomImpl(random.Next()), tokenSource.Token).Forget();
60+
PressKeys(new RandomWrapper(random.Next()), tokenSource.Token).Forget();
61+
MoveMouse(new RandomWrapper(random.Next()), tokenSource.Token).Forget();
6262

6363
var expireTime = Time.time + 10.0f; // 10秒間動作させる(3分以上にする場合はTimeout属性でタイムアウト時間を延長)
6464
while (Time.time < expireTime)
@@ -117,7 +117,7 @@ private async UniTask MoveMouse(IRandom random, CancellationToken token)
117117
while (true)
118118
{
119119
var mouseDelta = random.NextNormalizedVector2(); // マウスの移動量を抽選
120-
_input.Set(mouse.delta, mouseDelta); // マウス移動
120+
_input.Set(mouse.delta, mouseDelta); // マウス移動
121121

122122
await UniTask.NextFrame(cancellationToken: token);
123123
}

Assets/UGUIExample/Tests/Runtime/MonkeyTest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
// Copyright (c) 2021-2023 Koji Hasegawa.
1+
// Copyright (c) 2021-2025 Koji Hasegawa.
22
// This software is released under the MIT License.
33

44
using System;
55
using System.Threading.Tasks;
66
using Cysharp.Threading.Tasks;
77
using NUnit.Framework;
8-
using TestHelper.Monkey;
98
using TestHelper.Random;
9+
using TestHelper.UI;
1010
using UnityEngine;
1111
using UnityEngine.SceneManagement;
1212

@@ -22,18 +22,18 @@ public class MonkeyTest
2222
[Test]
2323
public async Task MonkeyTesting()
2424
{
25-
var random = new RandomImpl(); // 擬似乱数生成器
25+
var random = new RandomWrapper(); // 擬似乱数生成器
2626
Debug.Log($"Random that monkey uses: {random}"); // シード値をログ出力
2727

2828
await SceneManager.LoadSceneAsync("MainMenu");
2929
// Note: ランダム要素のあるSceneの場合、擬似乱数シードにrandom.Next()を使用すると再現に必要なシード値が1つで済んで便利です
3030

3131
var config = new MonkeyConfig
3232
{
33-
Lifetime = TimeSpan.FromSeconds(5), // 5秒間動作(3分以上にする場合はTimeout属性でテスト自体のタイムウトを延ばすこと)
34-
DelayMillis = 200, // 操作間隔は200ms
33+
Lifetime = TimeSpan.FromSeconds(5), // 5秒間動作(3分以上にする場合はTimeout属性でテスト自体のタイムウトを延ばすこと)
34+
DelayMillis = 200, // 操作間隔は200ms
3535
SecondsToErrorForNoInteractiveComponent = 5, // 5秒無操作で失敗扱い
36-
Random = random, // 擬似乱数生成器を指定
36+
Random = random, // 擬似乱数生成器を指定
3737
};
3838

3939
await Monkey.Run(config);

Assets/UGUIExample/Tests/Runtime/UGUIExample.Tests.asmdef

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"name": "UGUIExample.Tests",
3+
"rootNamespace": "",
34
"references": [
45
"UnityEngine.TestRunner",
56
"UnityEditor.TestRunner",
67
"UGUIExample",
78
"UniTask",
89
"TestHelper",
9-
"TestHelper.Monkey",
10-
"TestHelper.Random"
10+
"TestHelper.Random",
11+
"TestHelper.UI"
1112
],
1213
"includePlatforms": [],
1314
"excludePlatforms": [],

Packages/manifest.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"dependencies": {
33
"com.cysharp.unitask": "2.5.0",
4-
"com.nowsprinting.create-script-folders-with-tests": "1.2.1",
4+
"com.nowsprinting.create-script-folders-with-tests": "1.2.3",
55
"com.nowsprinting.local-package-sample": "file:../LocalPackages/com.nowsprinting.local-package-sample",
6-
"com.nowsprinting.test-helper": "0.3.0",
7-
"com.nowsprinting.test-helper.input": "1.0.0",
8-
"com.nowsprinting.test-helper.monkey": "0.5.1",
9-
"com.nowsprinting.test-helper.random": "0.2.0",
6+
"com.nowsprinting.test-helper": "1.2.1",
7+
"com.nowsprinting.test-helper.input": "1.0.1",
8+
"com.nowsprinting.test-helper.random": "1.0.0",
9+
"com.nowsprinting.test-helper.ui": "1.0.1",
1010
"com.unity.collab-proxy": "1.14.18",
1111
"com.unity.ide.rider": "3.0.34",
1212
"com.unity.ide.visualstudio": "2.0.22",

Packages/packages-lock.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"url": "https://package.openupm.com"
99
},
1010
"com.nowsprinting.create-script-folders-with-tests": {
11-
"version": "1.2.1",
11+
"version": "1.2.3",
1212
"depth": 0,
1313
"source": "registry",
1414
"dependencies": {},
@@ -27,40 +27,40 @@
2727
"dependencies": {}
2828
},
2929
"com.nowsprinting.test-helper": {
30-
"version": "0.4.2",
31-
"depth": 1,
30+
"version": "1.2.1",
31+
"depth": 0,
3232
"source": "registry",
3333
"dependencies": {
3434
"com.unity.test-framework": "1.3.4"
3535
},
3636
"url": "https://package.openupm.com"
3737
},
3838
"com.nowsprinting.test-helper.input": {
39+
"version": "1.0.1",
40+
"depth": 0,
41+
"source": "registry",
42+
"dependencies": {},
43+
"url": "https://package.openupm.com"
44+
},
45+
"com.nowsprinting.test-helper.random": {
3946
"version": "1.0.0",
4047
"depth": 0,
4148
"source": "registry",
4249
"dependencies": {},
4350
"url": "https://package.openupm.com"
4451
},
45-
"com.nowsprinting.test-helper.monkey": {
46-
"version": "0.5.1",
52+
"com.nowsprinting.test-helper.ui": {
53+
"version": "1.0.1",
4754
"depth": 0,
4855
"source": "registry",
4956
"dependencies": {
5057
"com.cysharp.unitask": "2.3.3",
51-
"com.nowsprinting.test-helper": "0.4.2",
52-
"com.nowsprinting.test-helper.random": "0.2.0",
58+
"com.nowsprinting.test-helper": "1.1.1",
59+
"com.nowsprinting.test-helper.random": "1.0.0",
5360
"com.unity.ugui": "1.0.0"
5461
},
5562
"url": "https://package.openupm.com"
5663
},
57-
"com.nowsprinting.test-helper.random": {
58-
"version": "0.2.0",
59-
"depth": 0,
60-
"source": "registry",
61-
"dependencies": {},
62-
"url": "https://package.openupm.com"
63-
},
6464
"com.unity.addressables": {
6565
"version": "1.17.15",
6666
"depth": 1,

0 commit comments

Comments
 (0)