Unity Test Runner messes up the plugins on my project.

Hello folks,

I’ve been trying following this tutorial Introduction To Unity Unit Testing | Kodeco on implementing Unit Testing on my project.

However, as soon as I put the “GameAssembly” into the Assembly Definition References, an error pops for each plugin in my project.

I’m DEFINITELY missing something very easy to understand, but I can’t find an answer.

So, what should I do?

Thanks in advance.

Where in your project did you put the .asmdef (Assembly definition) file ?

I have an asmdef into Assets/Tests and one into Assets/Scripts

and where is PDFViewer (i assume this is a plugin?) placed?

All of my plugins are in Assets/Plugins/PDFViewer

So, before using .asmdef files, all your code would get compiled into a single assembly (well - 1 for runtime and 1 for editor code).

With this setup now, anything under Assets/Scripts will get compiled into 1 assembly, and everything under Assets/Tests will be compiled into another assembly.

These assemblies do not automatically reference any other code, and since your code under Assets/Plugins is not part of those assemblies, and it is not references by anything, you get this error.

To solve this, you can set up your Assets/Plugins under its own assembly definition and have your main assembly reference that.

1 Like

Ok, I did as you said, and the errors are just multiplying…

Say, if in Assets/Plugins I have several folders each with a different plugin, do I have to put an asmdef on each folder or can I just put an asmdef in Assets/Plugins that automatically compiles every plugin? I did the second, and the errors persist.

The .asmder applies to the current folder or subfolders.

I think u can try to put it in Plugins.