[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.
Answer by Eji4h · Feb 02, 2018 at 06:26 PM
Step:
Install via NuGet (https://www.nuget.org/packages/NSubstitute)
Go to packages\NSubstitute.[3.1.0 or another version]\lib\net[version]
Example: UnityProject\packages\NSubstitute.3.1.0\lib\net46Copy NSubstitute.dll in directory to some Editor folder
I solve this issue today.
Answer by michaelvmata · Jan 31, 2018 at 07:40 PM
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.
I didn't follow that exact link (it leads to a page not found, btw), but I did get the latest release and import the Net35 dll. I even put it into the Editor folder as the tutorial said. Didn't work.
Your answer
Follow this Question
Related Questions
Replaced '_Object2World' with 'unity_ObjectToWorld' 1 Answer
Can't find shader on iOS - GpuProgram creation error: shader program type is unrecognised. 2 Answers
Why monodevelop is not opening in Unity 5? 0 Answers
Visual Studio integration with Unity broken 1 Answer
Canvas not rendered by camera 1 Answer