Running with Resharper 5.1.3

Feb 8, 2011 at 6:53 PM

When I try running AgUnit .2 with Resharper 5.1.3, I get the following error:

Unit Test Runner failed to load test assembly:JetBrains.ReSharper.TaskRunnerFramework.TaskException:
Could not load file or assembly 'JetBrains.ReSharper.UnitTestRunner.MSTest, Version=5.1.1766.4, Culture=neutral, PublicKeyToken=1010a0d8d6380325' or one of its dependencies.
The system cannot find the file specified.

I'm guessing AgUnit needs to be rebuilt against the new Resharper build, yes? Or is there some way to get it working as is?

Coordinator
Feb 8, 2011 at 7:29 PM

Hi,

You're correct that AgUnit needs to be updated for the 5.1.3 release.

I would advise sticking with resharper 5.1.2 for now, as 5.1.3 is only a minor bugfix release.

The only way to get it working now is taking the AgUnit source code and just building it against the new release. No source code changes should be necessary.
Just unload the Resharper50 project, and point the reference paths (in the project properties) of the Resharper51 project to the Bin path of your Resharper installation.

I'm working on a 0.3 release for AgUnit, that fixes some bugs that were introduced in 0.2. It should be available somewhere next week and it will be built against 5.1.3.

Greetings,

Steven

Feb 8, 2011 at 8:15 PM

OK, I got it rebuilt against 5.1.3 and it's working great.  Thanks for the directions. 

Feb 22, 2011 at 9:44 AM

I also got it built against Resharper 5.1.3, but when I add the dll's to Resharper's plugins folder and restart VS2010 and run tests, it fails with something like:

Unhandled error in Silverlight Application
Code: 2105
Category: InitializeError
Message: failed to load pre-requisites for the application

I'm not sure whether it is a problem with the assemblies I've built or something else with my Silverlight test project.

@SDeKock: Will you build the 0.3 release of AgUnit in the near future?

Greetings,
Mikkel

Coordinator
Feb 22, 2011 at 9:53 AM
Edited Feb 22, 2011 at 9:55 AM

Hi Mikkel,

The "failed to load pre-requisites for the application" is caused by a reference that is missing or failed to load.

Can you check that your test project has all the following references ?
Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight, mscorlib, system, System.Core, System.Windows, System.Windows.Browser, System.Xml, System.Xml.Linq

System.Xml.Linq is not added when you create a new Silverlight project, so make sure you have that one.

Let me know if this fixes your problem. 

Greetings,

Steven 

Feb 23, 2011 at 7:46 AM

Hi Steven,

Thanks for the quick answer. System.Xml.Linq was missing in my test project. Adding it as reference fixed the problem :-)

Greetings,
Mikkel

Mar 9, 2011 at 2:01 PM

I just stumbled upon AgUnit today, and it made my day.  Then I read this thread about not working with ReSharper 5.1.3 and my heart sank.  Before I distract myself from my current effort, is there a plan for when a release for 5.1.3 is planned?  Alternatively, could anything be done with Assembly Binding Redirection?

Coordinator
Mar 9, 2011 at 2:23 PM

Hi Trinition,

You can download the latest source code and build it. It will build successfully against 5.1.3.

I've not created a new release yet, because there's a bug (also in the 0.2 release) that I want fixed first, but I have not found the time yet to do so.

But since you're not the first one to request this, I'll a build for R# 5.1.3 to the AgUnit 0.2 release by tomorrow. And I'll plan the 0.3 release, with the bugfixes, for next week.

Let me know how it turns out for you!

Greetings,
Steven 

Mar 16, 2011 at 3:02 PM

Steven, were you able to do a R# 4.1.3 build of AgUnit 0.2?  If you did, I'm not looking for it in the right place.

Mar 16, 2011 at 6:31 PM

FWIW, I bit the bullet and hand-built my own copy against R# 5.1.3 (I mis-typed 4.1.3 in my previous post).  Appears to be working fine except for two things:

  1. How does one apply the plugin to VS2010?  Its not in ReSharper's "Plugins..." window.  I added it to the command line, as your README.TXT said for testing it, but I was hoping there was a cleaner way for actually using it.
  2. When I pick to "Run" from the margin indicator on my TestClass (as opposed to one of my TestMethods), it does NOT discover all of the TestMethods and show them in the "Unit Test Sessions" tree.  Instead, just the test class node shows up, and it says "Tests failed: 0, passed: 1, ignored: 0" even though I have 13 TestMethods in my TestClass.  Unless I'm remembering incorrectly, R# proper will add a TestMethod node in the "Unit Test Sessions" tree for each TestMethod and then run all 13 (for non-Ag tests, of course).  AgUnit actually DOES do this when I choose to run the tests from the TestClass in the Unit Text Explorer.
Coordinator
Mar 16, 2011 at 7:04 PM

Hi,

First of all, I didn't get around to creating the release for R# 5.1.3. I'm sorry for the delay.

To apply the plugin to Resharper, it's enough to put it in the plugins folder, usually "C:\Program Files (x86)\JetBrains\ReSharper\v5.1\Bin\Plugins".
It's possible that there's no Plugins folder in the Bin folder, but in that case you can just create it. What I usually do is create a subfolder in the Plugins folder too:
I have my plugin in "C:\Program Files (x86)\JetBrains\ReSharper\v5.1\Bin\Plugins\AgUnit-0.2-for-ReSharper-5.1.1753.4" although this isn't necessary.

About your second point, this was the bug I was talking about I want to have fixed for the 0.3 release.
For now I recommend using the "Run unit tests" context menu entry or keyboard shortcut.
I'll try to fix the issue as soon as possible, but I have been preoccupied lately. 

Greetings,

Steven

Mar 17, 2011 at 12:49 PM

No problem on the 5.1.3 build.  I got to a stopping point in my recent effort and took the plunge to building this myself.  It was pretty simple.

I plan to re-do the way I have my plugin set up, using the approach you describe.

Regarding the bug, I heard you mention "a" bug but didn't realize it was "this" bug.  All-in-all, not a very severe bug!

Regarding keyboard shortcuts, I still have some difficulty getting them the way I want.  We have both unit tests (which we run as part of our CI build) and integration tests (which are too fragile to include in CI), so I can't just run "all tests in solution".  Instead, I use the explorer to set up some sessions.  But I've not gotten around to seeing if I can assign hotkeys to them.

Anyways, thank you for all of your hard work on this plugin... it's really going to make my daily work smoother!

Coordinator
Mar 17, 2011 at 1:31 PM
Edited Mar 17, 2011 at 1:32 PM

About the keyboard shortcuts:

In the options of visual studio you can bind the following commands to keyboard shortcuts:

ReSharper.ReSharper_UnitTest_ContextRun
ReSharper.ReSharper_UnitTest_ContextDebug
ReSharper_AgUnit_UnitTestSilverlightContextDebug

These correspond to the 3 context menu items: "Run unit tests" "Debug unit tests" and "Silverlight debug unit tests" respectively.

These are all context sensitive. If you run them when you have your cursor in a test, they will run only that test. If you run it when you have a file selected, it will only run that file. If you have a folder selected, will only run tests inside that folder.

You can use that to only run tests from a specific namespace or project, for example your unit tests and not your integration tests.

I hope this is any help to you :)

Greetings,

Steven