[OT] NUnit Question

C

Cool Guy

I have a solution containing two projects. Each is a class library. One
is an actual library, while the other merely contains unit tests.

The unit testing project references the library project. It all compiles
fine.

But when I run NUnit specifying the unit testing project DLL as input, all
the tests fail with an error message reading that my library (which the
unit test project references) could not be found.

How do I work around this?
 
G

Guest

Do you have Visual Studio? If so try running NUit directly from Visual
Studio and see if it works. You can do this by:

1. Setting you NUnit project as the starting project (righ click on the
project and choose "Set as Startup project".

2. Set project run properties, right click on the project and choose
properties, in the properties window go to the configuration properties
folder and then choose the Debugging submenu.

3. Change the "Debug Mode" property to Program, then click the "Apply"
button (v. important)

4. Choose the Nunit-gui.exe file as the "Start Application" it should be
somewhere like "C:\program files\nunit2.2\bin"

5. Run you solution and you will see Nunit start, this should definitely work.

You can also do the above to allow you to step in and debug your unit tests
running inside NUnit.

Other possible reasons:
Did you copy your NUnit dll to another location after you compiled? This
would cause problems. Also what is the exact error you are seeing?

Hope that helps
Mark R Dawson
 
J

Jianwei Sun

Cool said:
I have a solution containing two projects. Each is a class library. One
is an actual library, while the other merely contains unit tests.

The unit testing project references the library project. It all compiles
fine.

But when I run NUnit specifying the unit testing project DLL as input, all
the tests fail with an error message reading that my library (which the
unit test project references) could not be found.

How do I work around this?
Cool Guy,

Do you have your library dll in the same directoy as the unit testing
project dll, that may be the issue.

HTH

Jianwei
 
C

Cool Guy

Mark R. Dawson said:
Do you have Visual Studio? If so try running NUit directly from Visual
Studio and see if it works.

I'll try what you suggest in a while but what I'm trying already should
work and I don't see why it doesn't.
 
C

Cool Guy

Jianwei Sun said:
Do you have your library dll in the same directoy as the unit testing
project dll [...]

No. The library is structured thus:

Library
|
|__Library
|
|__Testing
 
E

Edwin Yip

Hi,
where did you load the assembly, generally if you load the assembly under
bin/release or bin/debug, all assemblies refferenced by it will be there,
and in this case there should be no problem.


NUnitPartner--Automatic NUnit test case generation!
http://www.freewebs.com/edwinyeah/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top