简体   繁体   中英

How to import DLL to c# testing project

Im working through the below tutorial on NUnit at the moment, but Im stuck about halfway through because I dont know what the author is referring to when he says 'Import the downloaded DLL files into the project'. Can anyone take a look and tell me what these dll files are? I have done all the coding up to this point, I'm just not sure what these are/ how to import them to my project. Thanks.

http://www.codeproject.com/Articles/178635/Unit-Testing-Using-NUnit

Use the Package Manager Console and issue this command:

Install-Package NUnit.Runners

That's probably what the author meant, but NuGet is the way to go these days.

Note that if you have Resharper, Continuous Tests, NCrunch etc, you don't need the old-fashioned NUnit runner and can use the ones built into those tools. In which case you need NUnit rather than NUnit.Runners .

You need to add a reference to nunit.framework.dll , which you have probably downloaded earlier. Better yet, use nuget to install it: Install-Package NUnit

The projects are available for download. You'll see the author created NUnit_Application (a console app) and NUnit_Application.Test (a class library). You will also see a folder called "NUnit Rferences" under NUnit_Application. When he says import the downloaded dll, he means put it anywhere on your hard drive (in this case he put it under the NUnit_Application folder) and add a reference to it (nunit.framework.dll) via the "Add References". In this case, the NUnit_Application.Test would be referencing that dll, as its the one using the classes within that dll.

Note that the author is downloading and referencing the dll's manually. You can achieve the same via NuGet.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM