[Solved] NSubstitute doesn't register in Unity

I downloaded NSubstitute to follow a tutorial on unit testing with Unity, and I imported the .net 3.5 dll into my project. Even after applying the settings (all the defaults), I just can’t use NSubstitute in code. Putting

using NSubstitute;

in my code gets me an error asking me if I’m missing an assembly reference. I’d really appreciate help with this.

I’m using Unity 5.6.2f1 on Windows 10.

Edit: Turns out that the reason NSubstitute didn’t register, was because I was supposed to put it in a folder called Plugins, not Editor. I guess that’s how it worked in Unity 5.6, rather than the version the tut used.

Step:

  1. Install via NuGet (https://www.nuget.org/packages/NSubstitute)
  2. Go to packages\NSubstitute.[3.1.0 or another version]\lib
    et[version]

Example: UnityProject\packages\NSubstitute.3.1.0\lib
et46
3. Copy NSubstitute.dll in directory to some Editor folder

I solve this issue today.

Download the latest release from https://github.com/nsubstitute/NSubstitute/downloads. Uncompress the zip file. Take lib/NET35/NSubstitute.dll and import new asset into your project.