Resharper External Attributes with MSTest [DeploymentItem]

In some cases (such as when writing a URI in XAML) ReSharper magically figures out that I am writing out the relative path to a file in the current project and offers a very useful smart completion for it and a warning if I am wrong or wrong, and even goes to file if I press Ctrl + click.

Can I somehow tell ReSharper to do the same when I type a parameter in the MSTest DeploymentItem attribute?

+3


source to share


1 answer


This should work through external annotation . Open the following file:

C: \ Program Files (x86) \ JetBrains \ ReSharper \ v7.1 \ Bin \ ExternalAnnotes \ Visual Studio \ Microsoft.VisualStudio.QualityTools.UnitTestFramework.xml

(or whatever version of Resharper you are using.)

Add these lines to the tag assembly

:



<member name="M:Microsoft.VisualStudio.TestTools.UnitTesting.DeploymentItemAttribute.#ctor(System.String)">
    <parameter name="path">
        <attribute ctor="M:JetBrains.Annotations.PathReferenceAttribute.#ctor" />
    </parameter>
</member>
<member name="M:Microsoft.VisualStudio.TestTools.UnitTesting.DeploymentItemAttribute.#ctor(System.String,System.String)">
    <parameter name="path">
        <attribute ctor="M:JetBrains.Annotations.PathReferenceAttribute.#ctor" />
    </parameter>
</member>

      

This tells Resharper to fail on both constructors PathReference

attribute .path

DeploymentItem

However, after testing for some time, I cannot see this attribute working on what I am trying to use in a C # text editor. Maybe it doesn't work for my version (7.1), but I'm a bit stumped. Maybe someone can add to this?

+1


source







All Articles