Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #18403 from sharwell/workitem-doc
Updated WorkItemAttribute documentation
  • Loading branch information
sharwell committed Jul 6, 2017
2 parents 601d68b + 9f4e3d5 commit 2f1fa44
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 23 deletions.
Expand Up @@ -447,7 +447,9 @@ public void TestRuleSetInclude()
Assert.Equal(ruleSet.Includes.First().IncludePath, "foo.ruleset");
}

#pragma warning disable CA2243 // Attribute string literals should parse correctly
[WorkItem(1184500, "DevDiv 1184500")]
#pragma warning restore CA2243 // Attribute string literals should parse correctly
[Fact]
public void TestRuleSetInclude1()
{
Expand Down
Expand Up @@ -261,7 +261,7 @@ Next
Assert.Empty(model.LookupLabels(source.Length - 1))
End Sub

<WorkItem(3795, "https:'github.com/dotnet/roslyn/issues/3795")>
<WorkItem(3795, "https://github.com/dotnet/roslyn/issues/3795")>
<Fact>
Public Sub ErrorInUsing()
Dim submission = VisualBasicCompilation.CreateScriptCompilation("sub1", Parse("Imports Unknown", options:=TestOptions.Script), {MscorlibRef})
Expand Down
Expand Up @@ -734,7 +734,7 @@ End Module

#End Region

<Fact, WorkItem(1319, "https: //github.com/dotnet/roslyn/issues/1319")>
<Fact, WorkItem(1319, "https://github.com/dotnet/roslyn/issues/1319")>
Public Sub MultipleNetmodulesWithAnonymousTypes()
Dim compilationDef1 =
<compilation>
Expand Down
Expand Up @@ -2105,7 +2105,9 @@ void M(C left, C right)
MainDescription("C C.operator +(C left, C right)"));
}

#pragma warning disable CA2243 // Attribute string literals should parse correctly
[WorkItem(792629, "generic type parameter constraints for methods in quick info")]
#pragma warning restore CA2243 // Attribute string literals should parse correctly
[Fact, Trait(Traits.Feature, Traits.Features.QuickInfo)]
public async Task GenericMethodWithConstraintsAtDeclaration()
{
Expand All @@ -2117,7 +2119,9 @@ public async Task GenericMethodWithConstraintsAtDeclaration()
MainDescription("TOut C.Foo<TIn, TOut>(TIn arg) where TIn : IEquatable<TIn>"));
}

#pragma warning disable CA2243 // Attribute string literals should parse correctly
[WorkItem(792629, "generic type parameter constraints for methods in quick info")]
#pragma warning restore CA2243 // Attribute string literals should parse correctly
[Fact, Trait(Traits.Feature, Traits.Features.QuickInfo)]
public async Task GenericMethodWithMultipleConstraintsAtDeclaration()
{
Expand All @@ -2130,7 +2134,9 @@ public async Task GenericMethodWithMultipleConstraintsAtDeclaration()
MainDescription("TOut C.Foo<TIn, TOut>(TIn arg) where TIn : Employee, new()"));
}

#pragma warning disable CA2243 // Attribute string literals should parse correctly
[WorkItem(792629, "generic type parameter constraints for methods in quick info")]
#pragma warning restore CA2243 // Attribute string literals should parse correctly
[Fact, Trait(Traits.Feature, Traits.Features.QuickInfo)]
public async Task UnConstructedGenericMethodWithConstraintsAtInvocation()
{
Expand Down
Expand Up @@ -115,9 +115,11 @@ public delegate void EvHandler(int x);
Await TestAsync(input, expected)
End Function

#Disable Warning CA2243 ' Attribute string literals should parse correctly
<WorkItem(144843, "Generate method stub generates into *.Designer.cs")>
<Fact, Trait(Traits.Feature, Traits.Features.CodeActionsGenerateEvent)>
Public Async Function PreferNormalFileOverAutoGeneratedFile_Basic() As Task
#Enable Warning CA2243 ' Attribute string literals should parse correctly
Dim input =
<Workspace>
<Project Language="Visual Basic" AssemblyName="VBAssembly1" CommonReferences="true">
Expand Down
Expand Up @@ -1079,9 +1079,11 @@ End Module]]>

#Region "Normal tests"

#Disable Warning CA2243 ' Attribute string literals should parse correctly
<WorkItem(144843, "Generate method stub generates into *.Designer.cs")>
<Fact, Trait(Traits.Feature, Traits.Features.CodeActionsGenerateMethod)>
Public Async Function PreferNormalFileOverAutoGeneratedFile_CSharp() As Task
#Enable Warning CA2243 ' Attribute string literals should parse correctly
Dim input =
<Workspace>
<Project Language="C#" CommonReferences="true">
Expand Down Expand Up @@ -1137,9 +1139,11 @@ partial class UserControl1
Await TestAsync(input, fileNameToExpected:=expectedFileWithText)
End Function

#Disable Warning CA2243 ' Attribute string literals should parse correctly
<WorkItem(144843, "Generate method stub generates into *.Designer.cs")>
<Fact, Trait(Traits.Feature, Traits.Features.CodeActionsGenerateMethod)>
Public Async Function IntoAutoGeneratedFileIfNoBetterLocationExists_CSharp() As Task
#Enable Warning CA2243 ' Attribute string literals should parse correctly
Dim input =
<Workspace>
<Project Language="C#" CommonReferences="true">
Expand Down Expand Up @@ -1181,9 +1185,11 @@ partial class UserControl1
Await TestAsync(input, fileNameToExpected:=expectedFileWithText)
End Function

#Disable Warning CA2243 ' Attribute string literals should parse correctly
<WorkItem(144843, "Generate method stub generates into *.Designer.cs")>
<Fact, Trait(Traits.Feature, Traits.Features.CodeActionsGenerateMethod)>
Public Async Function InAutoGeneratedFiles_CSharp() As Task
#Enable Warning CA2243 ' Attribute string literals should parse correctly
Dim input =
<Workspace>
<Project Language="C#" CommonReferences="true">
Expand Down Expand Up @@ -1224,9 +1230,11 @@ class Form1
Await TestAsync(input, fileNameToExpected:=expectedFileWithText)
End Function

#Disable Warning CA2243 ' Attribute string literals should parse correctly
<WorkItem(144843, "Generate method stub generates into *.Designer.cs")>
<Fact, Trait(Traits.Feature, Traits.Features.CodeActionsGenerateMethod)>
Public Async Function PreferNormalFileOverAutoGeneratedFile_Basic() As Task
#Enable Warning CA2243 ' Attribute string literals should parse correctly
Dim input =
<Workspace>
<Project Language="Visual Basic" CommonReferences="true">
Expand Down Expand Up @@ -1274,9 +1282,11 @@ End Class
Await TestAsync(input, fileNameToExpected:=expectedFileWithText)
End Function

#Disable Warning CA2243 ' Attribute string literals should parse correctly
<WorkItem(144843, "Generate method stub generates into *.Designer.cs")>
<Fact, Trait(Traits.Feature, Traits.Features.CodeActionsGenerateMethod)>
Public Async Function IntoAutoGeneratedFileIfNoBetterLocationExists_Basic() As Task
#Enable Warning CA2243 ' Attribute string literals should parse correctly
Dim input =
<Workspace>
<Project Language="Visual Basic" CommonReferences="true">
Expand Down Expand Up @@ -1312,9 +1322,11 @@ End Class
Await TestAsync(input, fileNameToExpected:=expectedFileWithText)
End Function

#Disable Warning CA2243 ' Attribute string literals should parse correctly
<WorkItem(144843, "Generate method stub generates into *.Designer.cs")>
<Fact, Trait(Traits.Feature, Traits.Features.CodeActionsGenerateMethod)>
Public Async Function InAutoGeneratedFiles_Basic() As Task
#Enable Warning CA2243 ' Attribute string literals should parse correctly
Dim input =
<Workspace>
<Project Language="Visual Basic" CommonReferences="true">
Expand Down
Expand Up @@ -1010,7 +1010,7 @@ class C

End Function

<WorkItem(724, "#724")>
<WorkItem(724, "https://github.com/dotnet/roslyn/issues/724")>
<Fact, Trait(Traits.Feature, Traits.Features.Simplification)>
Public Async Function TestCSharp_SimplifyParenthesesInsideInterpolation3() As Task
Dim input =
Expand Down Expand Up @@ -1043,7 +1043,7 @@ class C

End Function

<WorkItem(724, "#724")>
<WorkItem(724, "https://github.com/dotnet/roslyn/issues/724")>
<Fact, Trait(Traits.Feature, Traits.Features.Simplification)>
Public Async Function TestCSharp_SimplifyParenthesesInsideInterpolation4() As Task
Dim input =
Expand Down Expand Up @@ -1078,7 +1078,7 @@ class C

End Function

<WorkItem(724, "#724")>
<WorkItem(724, "https://github.com/dotnet/roslyn/issues/724")>
<Fact, Trait(Traits.Feature, Traits.Features.Simplification)>
Public Async Function TestCSharp_SimplifyParenthesesInsideInterpolation5() As Task
Dim input =
Expand Down Expand Up @@ -1113,7 +1113,7 @@ class C

End Function

<WorkItem(724, "#724")>
<WorkItem(724, "https://github.com/dotnet/roslyn/issues/724")>
<Fact, Trait(Traits.Feature, Traits.Features.Simplification)>
Public Async Function TestCSharp_SimplifyParenthesesInsideInterpolation6() As Task
Dim input =
Expand Down
Expand Up @@ -2577,7 +2577,7 @@ End Module

#End Region

<WorkItem(739, "#739")>
<WorkItem(739, "https://github.com/dotnet/roslyn/issues/739")>
<Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnnecessaryCast)>
Public Async Function TestRemoveAroundArrayLiteralInInterpolation1() As Task
Dim markup =
Expand All @@ -2597,7 +2597,7 @@ End Module
Await TestAsync(markup, expected, ignoreTrivia:=False)
End Function

<WorkItem(739, "#739")>
<WorkItem(739, "https://github.com/dotnet/roslyn/issues/739")>
<Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnnecessaryCast)>
Public Async Function TestRemoveAroundArrayLiteralInInterpolation2() As Task
Dim markup =
Expand All @@ -2617,7 +2617,7 @@ End Module
Await TestAsync(markup, expected, ignoreTrivia:=False)
End Function

<WorkItem(739, "#739")>
<WorkItem(739, "https://github.com/dotnet/roslyn/issues/739")>
<Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnnecessaryCast)>
Public Async Function TestRemoveAroundArrayLiteralInInterpolation3() As Task
Dim markup =
Expand Down
Expand Up @@ -1315,7 +1315,7 @@ End Class")

<WorkItem(2196, "https://github.com/dotnet/roslyn/issues/2196")>
<WorkItem(2197, "https://github.com/dotnet/roslyn/issues/2197")>
<WorkItem(29, "https: //github.com/dotnet/roslyn/issues/29")>
<WorkItem(29, "https://github.com/dotnet/roslyn/issues/29")>
<Fact, Trait(Traits.Feature, Traits.Features.CodeActionsSimplifyTypeNames)>
Public Async Function TestNullableSimplificationInsideCref() As Task
' NOTE: This will probably stop working if issues 2196 / 2197 related to VB compiler and semantic model are fixed.
Expand Down
Expand Up @@ -575,7 +575,7 @@ End class",
MainDescription("Integer()"))
End Function

<WorkItem(539240, "http: //vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539240")>
<WorkItem(539240, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539240")>
<Fact, Trait(Traits.Feature, Traits.Features.QuickInfo)>
Public Async Function TestOnArrayCreation2() As Task
Await TestAsync(<Text>
Expand Down
22 changes: 13 additions & 9 deletions src/Test/Utilities/Portable/Assert/WorkItemAttribute.cs
Expand Up @@ -10,23 +10,27 @@ namespace Roslyn.Test.Utilities
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
public sealed class WorkItemAttribute : Attribute
{
private readonly int _id;
private readonly string _description;

public int Id
{
get { return _id; }
get;
}

public string Description
public string Location
{
get { return _description; }
get;
}

public WorkItemAttribute(int id, string description)
/// <summary>
/// Initializes a new instance of the <see cref="WorkItemAttribute"/>.
/// </summary>
/// <param name="id">The ID of the issue in the original tracker where the work item was first reported. This
/// could be a GitHub issue or pull request number, or the number of a Microsoft-internal bug.</param>
/// <param name="issueUri">The URI where the work item can be viewed. This is a link to work item
/// <paramref name="id"/> in the original source.</param>
public WorkItemAttribute(int id, string issueUri)
{
_id = id;
_description = description;
Id = id;
Location = issueUri;
}
}
}
Expand Up @@ -1311,7 +1311,7 @@ End Module
}

[Fact]
[WorkItem(710, "#710")]
[WorkItem(710, "https://github.com/dotnet/roslyn/issues/710")]
[Trait(Traits.Feature, Traits.Features.RemoveUnnecessaryLineContinuation)]
public async Task DontRemoveLineContinuationInStringInterpolation1()
{
Expand All @@ -1332,7 +1332,7 @@ End Module
}

[Fact]
[WorkItem(710, "#710")]
[WorkItem(710, "https://github.com/dotnet/roslyn/issues/710")]
[Trait(Traits.Feature, Traits.Features.RemoveUnnecessaryLineContinuation)]
public async Task DontRemoveLineContinuationInStringInterpolation2()
{
Expand All @@ -1353,7 +1353,7 @@ End Module
}

[Fact]
[WorkItem(710, "#710")]
[WorkItem(710, "https://github.com/dotnet/roslyn/issues/710")]
[Trait(Traits.Feature, Traits.Features.RemoveUnnecessaryLineContinuation)]
public async Task DontRemoveLineContinuationInStringInterpolation3()
{
Expand Down

0 comments on commit 2f1fa44

Please sign in to comment.