Skip to content

Commit 57ada20

Browse files
Replace copy of attribute with appropriate NuGet package
1 parent ce87a5b commit 57ada20

File tree

1 file changed

+7
-39
lines changed

1 file changed

+7
-39
lines changed

src/NetAnalyzers/UnitTests/Microsoft.NetCore.Analyzers/Runtime/ProvideCorrectArgumentsToFormattingMethodsTests.cs

Lines changed: 7 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
1+
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
22

33
using System.Threading.Tasks;
44
using Microsoft.CodeAnalysis.Testing;
@@ -531,28 +531,9 @@ void M1(string param)
531531
{
532532
var a = MyFormat("""", 1);
533533
}
534-
}",
535-
@"
536-
namespace System.Diagnostics.CodeAnalysis
537-
{
538-
/// <summary>Specifies the syntax used in a string.</summary>
539-
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
540-
public sealed class StringSyntaxAttribute : Attribute
541-
{
542-
/// <summary>The syntax identifier for strings containing composite formats for string formatting.</summary>
543-
public const string CompositeFormat = nameof(CompositeFormat);
544-
545-
/// <summary>
546-
/// Initializes a new instance of the <see cref=""StringSyntaxAttribute""/> class with the identifier of the syntax used.
547-
/// </summary>
548-
/// <param name=""syntax"">The syntax identifier.</param>
549-
public StringSyntaxAttribute(string syntax)
550-
{
551-
}
552-
}
553-
}
554-
"
555-
}
534+
}"
535+
},
536+
ReferenceAssemblies = ReferenceAssemblies.Net.Net70,
556537
}
557538
};
558539

@@ -579,22 +560,9 @@ End Function
579560
Private Sub M1(ByVal param As String)
580561
Dim a = MyFormat("""", 1)
581562
End Sub
582-
End Class",
583-
@"
584-
Namespace System.Diagnostics.CodeAnalysis
585-
<AttributeUsage(AttributeTargets.Parameter Or AttributeTargets.Field Or AttributeTargets.Property, AllowMultiple := False, Inherited := False)>
586-
Public Class StringSyntaxAttribute
587-
Inherits Attribute
588-
589-
Public Const CompositeFormat As String = ""CompositeFormat""
590-
591-
Sub New(ByVal syntax As String)
592-
End Sub
593-
End Class
594-
End Namespace
595-
"
596-
597-
}
563+
End Class"
564+
},
565+
ReferenceAssemblies = ReferenceAssemblies.Net.Net70,
598566
}
599567
};
600568

0 commit comments

Comments
 (0)