Files
Umbraco-CMS/test/umbraco.Test/AuthoringTests.txt
shannon@ShandemVaio 96cc9a1f35 Missing file updates
2012-07-17 01:33:14 +06:00

30 lines
1.8 KiB
Plaintext

How to run these 'old' style unit tests. They require an HTTP Context so there are a few steps to take to make sure they work.
1. Make sure you have an umbraco instance configured, you will need some bare minimum data such as at least one content type,
media type, content node (your best bet is to install runway or CWS or something)
3. Create a new .testrunconfig file with your machine name in the 'Solution Items' folder
** Double click on your new .testrunconfig file and go to the Hosts section, update the config:
*** 'Run in default host'
*** Host type: ASP.NET
*** URL to test: the base url that your umbraco instance runs on (i.e. http://localhost:59454 )
*** Run tests in ASP.NET Development Server, Path to Web site: the physical folder path to the 'presentation'
folder of the 4.1 branch (the root of the umbraco site)
*** Web application root: /
4. In the 'Test' menu item of Visual Studio, change te 'Select active test settings' to your machines configuration file
5. Run all tests in the solution (You MUST use the VS test runner, not the resharper test runner.
You can do this from the 'Test' menu item and select run all tests in solution)
and see if it works (For some reason on my machine in VS2010, i can't have the website running while i run the
unit tests, in VS2008 this did work)
** If the tests don't work, you'll need to investigate why... could be just a config issue, a data issue or could
just be bugs and the tests only work on my machine :)
**** DEBUGGING INFO *******
debugging unit tests for ASP.Net (because it runs in a context) can't be debugged directly in the same VS as your running the tests.
Unfortunately the only way to do it is to add this line to your unit test you want to debug:
System.Diagnostics.Debugger.Launch();