情況:使用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。