初めてUnityで単体テストをしようと思いこちらの記事(https://light11.hatenadiary.com/entry/2020/02/21/212657)を参考にしてUnity Test Runnerを使い始めました。
そこでAssembly Definition Fileが入っているTestsフォルダーの中にテスト用のスクリプトを配置しました。
元々このゲームはnamespace としてBattleSceneとBattleScene.Magicがありその中のスクリプトをテストするため以下のように記述しました。
using System.Collections; using UnityEngine.TestTools; using NUnit.Framework; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; using System.Text; using UnityEngine; using UnityEngine.UI; using BattleScene; using BattleScene.Magic;
そうしたところThe type or namespace name 'BattleScene' could not be foundのエラーメッセージが出てしまいます。
なぜでしょうか?
またTestsフォルダー下にあるテスト用スクリプトをテスト対象のスクリプトが入っているBattleSceneという名前のフォルダーに移動させると以下のようなエラーメッセージに変わります。
The type or namespace name 'UnityTest' could not be found
The type or namespace name 'UnityTestAttribute' could not be found
スクリプトを配置するフォルダーとnamespsceは関係があるのでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/07/07 05:34