NUnit test results and reportunit - visual-studio

I am currently using NUnit in Visual Studio to execute my Selenium tests. What I want is some good reporting and I found ReportUnit.
What I cannot seem to figure out is where NUnit places the test result xml files on my machine. I am no tech-wiz so I am struggling to find out how to get ReportUnit working. I found the documentation here: http://relevantcodes.com/reportunit/
But cannot quite figure out how to get my test result files in a specific folder and then open them with ReportUnit.
Any help is appreciated.
Kind regards,
Anand

Use the --out option of nunit3-console.exe to specify where the result file should go. e.g.
nunit3-console.exe MyTests.dll --out=C:/TestResult.xml

Related

Is there a way to associate and execute protractor tests to MTM test cases?

Here's the background:
I've wrote my tests in protractor#visual studio and got it running successfully with the help of this guide;
Checked the project into TFS;
Now, my intention is to associate my protractor tests to microsoft case tests, then i intent to run against a environment (SCVMM).
I tried Coded Ui Test, but i found then a little bit slow.
Is there a way that i can get this done?
Thanks.
What I did was use Generic Tests to accomplish this.
Each Generic Test you create can represent a Protractor test. I just named them similarly. Then you can link the Generic Test to the MTM test. Simple as that.
I took it a step further and set the Generic Test up in such a way that it runs the Protractor test. This is really nice because Visual studio will recognize these tests in Test Explorer. So no more command prompt :)
Here's an example of one of mine:

Sharp Architecture Simple CRUD Application

i am trying to get start with the Sharp Architecture by building the test application mentioned here, i have followed through the steps given in the tutorial but hit a road block where the database schema generation is described. According to the tutorial running the test
IceCreamYouScreamCorp.Tests.SharpArchTemplate.Data.NHibernateMaps.CanGenerateDatabaseSchema
will generate the schema in the Database folder, i couldn't find this test in the generate application by Templify. Please anybody who knows the solution guide me how to run this test so to generate the database schema...
may be i have not pharsed the question well enough, i have figured out the solution
download the NUnit framework
runt the test by using the NUnit
it will create the desired database schema for the sample application
If you tryed to use the version 2.0.0.3, you will have this problem.
Try to select the "2.0.0.0" option on Templify.
To run the test, open NUnit GUI, and go to the following folder and open the .dll file:
[Your_Templifyed_Folder]\Solutions\[Your_Solution_Name].Tests\bin\Debug\[Your_Solution_Name].Tests.dll
Now you can see the right tests list in the NUnit interface.

How to use Jasper reports without templates

I would like to use Jasper reports and build the report without templates. How can i get started? I have all the necessary libraries but I don't know how to start and I couldn't find anything.
Thanks
Try DynamicReports, an open source and based on JasperReports. Take a look at following step by step tutorial.

Is there an API for running Visual Studio Unit Tests programmatically?

Is there an API for running Visual Studio Unit Tests programmatically?
Running MSTests.exe with Process.Start() does not work in the current scenario. What I'm looking for is something like the NUnit SimpleTestRunner.
Any ideas?
/Erik
You're correct in that there's no public API for the mstest framework. I wrote a manual replacement for mstest one day to see how hard it was, and it's not as simple as it looks (particularly if you want to take advantage of more than one CPU core), so beware of going down this path.
Personally I've always just run mstest.exe programatically and then parsed the resulting .trx XML file. Are there any particular reasons why you can't use Process.Start to run it?
P.S. Some of the strange behaviour of mstest.exe are solved if you pass the /noisolation command line parameter - give that a go if you feel so inclined :-)
Update: Erik mentions he wants to run the test API in the current thread so he can set the thread culture for globalization issues.
If you run a unit test under the debugger, you'll notice that mstest creates a bunch of threads, and runs all your tests in different threads, so this isn't likely to work even if you could access the API.
What I'd suggest doing is this:
From your test "runner" application, set an environment variable
Run mstest pointing it at the specific tests
Add a [ClassInitialize] (or [TestInitialize]) method which reads this environment variable and sets the culture
Profit!
After taking a deep dive with reflector into MSTest.exe and further down into the Visual Studio Unit Test stack, I found that the API used by MSTest is sealed up and made private so that i cannot be used from the outside.
Why not using Reflector and seeing how NUnit SimpleTestRunner is running the tests... And then use this technique...
You can make use of the Microsoft REST API's for TFS to run ms tests. Please refer to the documentation here.
I've linked to "Call a Rest API" so that you can see how you'd go about calling one of the REST API's for TFS.
Note that if your tests are linked to the build, they should run automatically every time a build is queued.
Here is the link to Run Functional Tests.
I've also discovered an article on using the TFS SDK API to run tests. Here is that link as well: Link to API Article

How to use PEX with NUnit tests in VS 2010?

I am aware that the current release of PEX allows use with the NUnit framework.
The thing is I can't configure it to use the NUnit framework.
In the Options -> PEX: What Exactly do i have to put in the "TestFramework" and "TestFrameworkDirectory".
I Have tried many combinations but failed to achieve any success.
I've went to the DevLabs forum in search for a solution, I've got a solution to the problem.
Here it is:
http://social.msdn.microsoft.com/Forums/en-US/pex/thread/5f7cc37d-0b8e-4bad-af6f-c53c5076e7c2
You have to set the "TestFramework" option to "NUnit" (without quotes) and the "TestFrameworkDirectory" option to the directory where the nunit.framework.dll file is located (if you used the .msi installer it's probably "%ProgramFiles%\NUnit x.y.z\bin\net-2.0\framework").

Resources