Reputation: 45
i have next errors:
The type or namespace name 'NUnit' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'UnitySetUpAttribute' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'UnitySetUp' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'TestAttribute' could not be found (are you missing a using directive or an assembly reference?)
More under a page:
Code: https://pastebin.com/5zTjwPZw
How fix it?
Upvotes: 4
Views: 10083
Reputation: 5169
I had the same issue in a custom package after updating to 2020.2.3f1.
In the case of packages (or if you are using assemblies), they now seem to enforce that Editor's only assemblies should be marked as such in the Platforms section of the inspector:
Upvotes: 2
Reputation: 9
Test code needs to be under Editor, so it compiles to the Assembly-CSharp-Editor-*.dll which has references to the nunit dlls.
I find this particularly confusing given a quick inspection of Assembly-CSharp-*.csproj will show the nunit.framework listed as a reference, and the fact that it will also build if you point msbuild at the generated solution within vscode (whilst simultaneously failing a Unity 'refresh').
Upvotes: 0