Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Referencing Main Project from a separate NUnit Test Library

I'm brand new to Unit Testing, fresh out of college, and suddenly responsible for developing and maintaining a fairly large application by myself. The previous developer (who just left the company) included NUnit with the project references, wrote a few empty test fixtures at the bottom of a couple classes, and never did anything else with it.

I'm afraid if I don't start writing unit tests now, while I'm refactoring and learning the system, I'll never get them done, but I'm having trouble understanding how to properly set up my test project.

I was told that I should keep my test project as a separate Class Library within the same solution, so I've made an OurApplication.Test Library project. I don't know how I reference the project that I'll be testing within it, though.

Guides online say to point it to my main project's .DLL... but there isn't one. Our project is a standalone application that doesn't generate a dll, and I'm not sure what I'm supposed to do in this case.

Any advice on what's wrong here, or pointers to more comprehensive guides would be greatly appreciated. I'd like to get this done the right way, and as soon as I can.

like image 826
KChaloux Avatar asked Feb 19 '23 01:02

KChaloux


1 Answers

If you're using Visual Studio you can add references to Projects within the solution as here referencing a console application from a test project

enter image description here

like image 131
Paul D'Ambra Avatar answered Mar 14 '23 23:03

Paul D'Ambra