How to run test projects in orchard cms? - c#

I have been trying to run my own test method in orchard cms , but visual studio does not detect test projects in the solution.is there any specific method to run tests in orchard?or this is a problem with visual studio itself not detecting the test classes.
thanks for your help.

Orchard uses NUnit tests, so you should install NUnit in your Visual Studio to be able to run the tests.

Related

Visual Studio 2017 For Mac doesn't show all Nunit Tests

So Visual Studio doesn't seem to register all my Unit Tests. I have no idea how to solve this, and google hasn't been able to help.
Most of the tests is for some reason labeled as "Inconclusive Tests". This is how the built in Unit Tests displays:
P.S. The test runner works fine when I run the tests in a terminal.
.NET Core test projects in Visual Studio for Mac 7.2 has a bug that would cause the test names to appear blank in the Unit Tests window. This problem was fixed in Visual Studio for Mac 7.3.

Unit Tests in Visual Studio 2015 don't run

Neither the integrated test environment nor Resharper won't run any unit tests.
When starting Visual Studio the Test Output Pane shows 10+ lines stating:
An exception was thrown while initializing part "Microsoft.VisualStudio.TestWindow.Controller.TestPlatformProvider".
This is what I've tried so far:
Clear folder %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
Create a simple test project with one class library, one class and one test library containing one unit test for that class
Uninstallation and new installation of Visual Studio 2015
All actions didn't fix the problem. Even the simple test won't run.
Running tests from command line using MSTest does work.
Ensure that your anti-virus programs are not quarantining Visual Studio components.
I had this problem when our corporate IT department changed our Sophos Protection Quarantine policy. VS2015 Unit testing stopped working for everyone, with a similar error.

is copying MSTest executable and related dlls is the only solution to run ms tests in non visual studio environment?

I need to come of with the approach where:
I need to run Visual Studio Unit/Integration tests in environment where visual studio will not be installed.
After lots of fiddling around i came up with one approach that is to copy MSTest.exe and related dlls into the machine and run the tests from command line.
As shown here (http://msdn.microsoft.com/en-us/library/ms182486.aspx)
But wondering is this the only solution to run visual studio tests, i.e Normal MSTests in the environment where there is no visual studio?
Any help from experienced geeks will really help :) :)

Turn visual studio project testfixtures into nunit dll

I have a visual studio project. I later added a .cs file for testing and have added the appropriate 'using' statements and [Test] and [Testfixture] attributes. When I open the nunit gui application, however, it only accepts .dll, .exe, and .nunit files. I was wondering what exact steps I need to take to execute the tests I wrote. Is it possible to do so directly in visual studio?
You should add the NUnit dll as a reference on your project.
JetBrains' Resharper is able to run the tests inside Visual Studio. Read more about Resharpers unittesting here. JetBrains has also developed a line coverage tool: dotCover.
Right now, Resharper is the best solution.
Test Driven .Net is the best free solution I know of.
Visual Studio 11 will finally allow for 3rd part testing framework plugins.

NUnit not working on Visual Studio 2010?

I'm new to NUnit and I just download it today and I can't get it working with visual studio. (I'm new to Visual Studio as well)
I'm following TekPub's Mastering C# 4.0 tutorial.
Screenshot: Something is missing within the red circle area. There should be some "green thing" on the side that let you double click on it and run the NUnit test.
http://dl.dropbox.com/u/20422001/NunitMissing.jpg
As you can see on the above screenshot, the NUnit seems not working....
Did I miss something? Please advice. Thanks
EDIT
This is how it SHOULD look like. I took a screenshot from the video tutorial:
http://dl.dropbox.com/u/20422001/nunit.jpg
and here is the project files:
http://dl.dropbox.com/u/20422001/MasteringCSharp.rar
As you can see, I don't have "Unit Test" Tab and "Unit Test Session"...
You aren't doing anything wrong. Out of the box, NUnit doesn't integrate directly with Visual Studio. The screenshot from the video appears to be using Resharper's test runner.
Typically testing with NUnit requires you to compile your test project and then load it into the NUnit GUI (nunit.exe) where the tests can be run from there. When using the NUnit GUI, the project will reload anytime the assembly is recompiled. (I sometimes prefer having this in a separate process as it doesn't tie up Visual Studio's UI, but that's a matter of preference.)
The added advantage of using a third party test runner like Resharper, TestDriven.net, Galileo, etc is that it allows you to run or debug the tests directly from within the IDE. You can accomplish the same thing using NUnit by configuring Visual Studio to attach to NUnit and debug your tests from the external process. This post shows you how.
I haven't seen that particular video, but it sounds like you need an NUnit test runner for Visual Studio.
Check out the following:
Visual NUnit 2010 - free!
TestDriven.net
ReSharper
That my friend is JetBrains' Resharper - it's a paid add-in to Visual Studio that allows you to run tests from within the IDE. Highly recommended if you're working for a prolonged period in VS.
Of course since you're just starting out, you could use the NUnit GUI to run your tests. You can also set it to run tests after each build.
Tools > Settings > Test Loader > Assembly Reload. Check "Re-Run last tests run". Apply changes

Categories