Can Visual Studio use color / highlight methods decorated with certain attributes

Is it possible to get Visual Studio (2010) or ReSharper to visualize method calls using different colors using custom attributes for these methods. For instance:

[Arrange]
private void ArrangeSomeVariablesAndSetup()
{
    ...
}

[Act]
private void ActOnThoseVariablesOrDoSomethingInteresting()
{
    ...
}

[Assert]
private void AssertThatSomethingHappeningThatWasExpecting()
{
    ...
}

Then, when calling these methods, Visual Studio should display them in color based on the attribute,

[Test]
public void MyTest()
{
    ArrangeSomeVariablesAndSetup(); <-- Renders in green
    ActOnThoseVariablesOrDoSomethingInteresting(); <-- Renders in blue
    AssertThatSomethingHappeningThatWasExpecting(); <-- Renders in yellow
}

(Attribute names and colors are used solely as an example, and I do not necessarily limit this to unit testing)

+3
source share
1 answer

-, ( ), , " " , .

, NUnit MSTest unit test, , . Benchmark . , " " () .

, / - , .

Visual Studio 2010 ( 2012 , ). 2013 2015 , Visual Studio 2015 - Roslyn . 2013 , . , , , .

, !

+1

All Articles