Unity報錯`NUnit' could not be found解決

情況:使用Unity,在mono建立一個NUnit測試文件時,發現在mono下可以測試,但在Unity下報錯...the type or namespace name `NUnit' could not be found. Are you missing a using directive or an assembly reference?

原因:unity的NUnit單元測試必須在Editor模式下執行,所以用Unity的話這個測試文件必須在Editor文件夾下。

解決:可以在Assets文件夾下建立Editor文件夾,在裏面寫NUnit。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章