bookthief
bookthief

Reputation: 2451

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

Upvotes: 1

Views: 6205

Answers (3)

Juan Ayala
Juan Ayala

Reputation: 3518

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.

Upvotes: 1

seldary
seldary

Reputation: 6256

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

Upvotes: 1

Neil Barnwell
Neil Barnwell

Reputation: 42085

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.

Upvotes: 1

Related Questions