XUnit compatibility with VS 2012 - Pro edition - visual-studio-2012

I am trying to implement xunit for test cases in my project and using VS 2012 Professional account.
The test case generation is done fine, but while running them, VS is unable to find any test case.
Tried running the test cases from VS inbuilt test option and using resharper's test option.
Please let me know, if some change in my approach is needed.

Related

VS 2012 Code Coverage

We are using VS2008 prof. in our application. In 2008 prof. code coverage feature isn’t available. So we are achieving this by creating unit test project and added its entry in .vsmdi file and running test cases we can get code coverage feature.
Now we are planning to migrate our application from VS2008 prof. to VS2012 prof. In VS2012 prof. also code coverage feature isn’t available. So we also trying the same VS2008 prof. approach to achieve it but still I am not getting code coverage option.
Please let me know if there is any way to achieve code coverage feature in VS2012.
Code Coverage is native only available in VS12 Premium and Ultimate not in Profesional. See here at "Determine how much code is being tested with code coverage analysis".
There are other alternatives that you can use to get code coverage (assuming you are using .NET) see What can I use for good quality Code Coverage for C#/.NET?.
I am partial to OpenCover for obvious reasons :)

how to generate dynamic parametrized unit test cases for c# application in vs 2012

I explored Pex , code digger for generation of unit test cases by exploring the code but found certain limitations in them .code digger requires portable class libraries whereas Pex requires vs 2010 . I need to know is there any tool to generate the unit test cases automatically for c# applications just like pex do or better than that that can be used with vs 2012 .
regards
priya

How can we use VS2012 Static Analysis Rules with FxCop 10 Standalone

We're struggling to get some rules that work fine in the VS2012 code analysis tool, to appear in FxCop 10.
Specifically we're trying to get CA2100 - "Review sql queries for security vulnerabilities"
We've tried adding the DLLs from VS2012 (11) but it doesn't seem to work.
Our goal is to ultimately run the VS2012 ruleset as part of a TeamCity build, so we'll probably end up with the cmd line version, but our build agents do not have vs installed and hence we need to use the standalone version.
Any help much appreciated
dan
The VS 2012 rule assemblies are compiled against a different version of the FxCop core assemblies than FxCop 10 (which is the same as that used for VS 2010), so no. However, if your goal is to run this as part of an automated build, the version of fxcopcmd.exe (plus its dependencies) found in your VS 2012 installation should work fine on your build server. Licensing considerations may, however, apply.

Testing using an upgraded VS2012 solution, but building in VS2010

So I've downloaded VS2012 RTM and upgraded my Coded UI test projects to the VS2012 versions.
The reason I have done this is because I was having issues with VS2010 Coded UI tools due to partial support of IE9.
So I ran the tests from my developer machine both locally and remotely (making use of the new Visual Studio agent tools), and the tests worked successfully. Presumably, the reason my tests now work is that VS2012 upgraded them so that they now work with IE9, right?
So - this is my problem. I want to automate these tests, by launching them from our build machine - but our build machine still runs on VS2010, and for the time-being this is not going to change.
So I checked in my new VS2012 Coded UI test solution into TFS and queued a new build - so the build machine built my solution. And the build was successful. All good there.
So, next I created a new test case in Microsoft Test Manager and associated with the ordered test list in my new solution. Then I launched the tests (using the existing VS2010 test controller) on my remote test environment (which has the existing VS2010 test agent tools).
But the tests failed - the same issues that affected my tests with the VS2010 Coded UI tests (due to lack of full support for IE9)
Why did they fail?
Do I need the new VS 2012 agent tools for my test controller and agents? Must I build my solution in VS2012?
Ideally, I don't want to have to install VS2012 RTM on my build machine - I want to do the minimum possible to get my tests working and automating.
Is there a way around this?
Your coded ui tests reference assemblies that come with VS installation or your agent's installation (the assemblies defininf the WpfControl, Mouse, Keyboard, Playback and other classes).
So if you run it on a build/test machine with older versions of the dll's the same issues are going to stay, the tests will not start using the newer fixed assemblies thatt were shipped with VS2012.
As a temporary workaround you can check what dll's you reference and make sure that the build process puts them in the same directory with your tests assembly. That way the lookup for them will find the in the current directory without using the /path and finding them in the VS installation directory.

Is code coverage available in VS2012 for metro-style apps?

I am using Windows 8 Pro and Visual Studio 2012 Ultimate (both RTM).
I create a Metro-style class library, and then a corresponding unit test library. Both target WinRT (not the .NET framework).
I can run unit tests fine, but when I attempt to "Analyze code coverage for all tests", the output window comes up with the results of the rebuild, and that's it. The Code Coverage Results window is all grayed out.
From reading on the web, some have alluded to the idea that code coverage is not enabled for WinRT assemblies, but I cannot confirm. I have also tried creating a .testsettings file, like was needed in VS2010 and explicitly turn on code coverage, and I got the same results.
Can anyone confirm or deny that code coverage is not available for WinRT-targeted assemblies, in VS2012 RTM?? I'm just trying to figure out if I'm missing some setting - or if it's not possible.
It's not possible at this stage due to the sandboxed nature of WinRT apps.
P.S. It's on the list of things the team is looking to resolve in the near future (no, I don't have a timeframe for it)

Resources