Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>1) Have a class you want to test in a .NET project (MyClass is the class name, MyProject is the project name, for example)</p> <p>2) Add another project to your solution called MyProject.Tests</p> <p>3) Add a reference from MyProject to MyProject.Tests so that you can access the class you want to test from the testing code</p> <p>3) In this new project add a new class file called MyClass (the same as the class in MyProject)</p> <p>4) In that class, add your testing code like this page explains -- <a href="http://www.nunit.org/index.php?p=quickStart&amp;r=2.4.8" rel="nofollow noreferrer">http://www.nunit.org/index.php?p=quickStart&amp;r=2.4.8</a></p> <p>5) When you've written your tests, build the solution. In the MyProject.Tests project folder a new folder will appear -- 'MyProject.Tests\bin\Debug'. That's assuming you built in Debug mode. If you built in Release mode it'll be MyProject.Test\bin\Release. Either will work. In this folder, you'll find a dll file called MyProject.Tests.dll </p> <p>6) Open the nUnit testing utility, File > Open, then navigate to the folder in #5 to find that MyProject.Tests.dll. Open it.</p> <p>7) The tests from the dll should be listed in the nUnit utility window, and you can now select which tests to run, and run them.</p> <p>Note: The naming convention isn't necessary, it's just the way I do it. If you have a project called 'MyProject' and you want your testing project to be called 'ArbitraryName' instead of 'MyProject.Test', then it'll still work... the naming convention just helps keep track of what exactly is being tested.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload