to detail how to get these unit tests actually running. In the future, if we need to write unit tests that absolutely require an HttpContext, we can use this project but it is not recommended. I'll be creating the new Unit Test project shortly which will be based on NUnit. I might actually be able to update these tests to run as NUnit too, we'll see.
22 lines
1.5 KiB
Plaintext
22 lines
1.5 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 :) |