Summary
Currently, [RetryAttribute] doesn't support decoration of a class or an assembly. This feature request aim to overcome such a limitation.
Background and Motivation
Currently, the attribute is defined as of version 4.0.2:
[AttributeUsage(
AttributeTargets.Method, AllowMultiple=false,
Inherited=false)]
public sealed class RetryAttribute : RetryBaseAttribute
This results in a test method like this:
[TestClass]
public class MyEndToEndIntegrationTests
{
[TestMethod, Retry(3)]
public void TestA() {}
[TestMethod, Retry(3)]
public void TestB() {}
[TestMethod, Retry(3)]
public void TestC() {}
}
Proposed Feature
Instead, the attribute would be defined as this:
[AttributeUsage(
AttributeTargets.Method | AttributeTargets.Class,
AllowMultiple=false, Inherited=false)]
public sealed class RetryAttribute : RetryBaseAttribute
Or even this:
[AttributeUsage(
AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly,
AllowMultiple=false, Inherited=false)]
public sealed class RetryAttribute : RetryBaseAttribute
Resulting in a test class like this:
[TestClass, Retry(3)]
public class MyEndToEndIntegrationTests
{
[TestMethod]
public void TestA() {}
[TestMethod]
public void TestB() {}
[TestMethod]
public void TestC() {}
}
Or even this:
Aspects to consider:
- Can a test method override (make it smaller or greater) the value set at a higher level (class, assembly)? If yes, what would be the behavior (permit, ignore, throw)?
Alternative Designs
N/D
Summary
Currently,
[RetryAttribute]doesn't support decoration of a class or an assembly. This feature request aim to overcome such a limitation.Background and Motivation
Currently, the attribute is defined as of version 4.0.2:
This results in a test method like this:
Proposed Feature
Instead, the attribute would be defined as this:
Or even this:
Resulting in a test class like this:
Or even this:
Aspects to consider:
Alternative Designs
N/D