From 6c38efb81c800d0aa8400972e7b717b951d86110 Mon Sep 17 00:00:00 2001 From: WeiZheng <13881045+wzchua@users.noreply.github.com> Date: Sat, 27 Aug 2022 14:04:40 +0800 Subject: [PATCH] Update test to use ReferenceAssemblies.Net70 --- .../Performance/ConstantExpectedTests.cs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/NetAnalyzers/UnitTests/Microsoft.NetCore.Analyzers/Performance/ConstantExpectedTests.cs b/src/NetAnalyzers/UnitTests/Microsoft.NetCore.Analyzers/Performance/ConstantExpectedTests.cs index 97311018d4..51dd7a0c18 100644 --- a/src/NetAnalyzers/UnitTests/Microsoft.NetCore.Analyzers/Performance/ConstantExpectedTests.cs +++ b/src/NetAnalyzers/UnitTests/Microsoft.NetCore.Analyzers/Performance/ConstantExpectedTests.cs @@ -1090,25 +1090,13 @@ private static async Task TestCSAsync(string source, params DiagnosticResult[] d var test = new VerifyCS.Test { TestCode = source, + ReferenceAssemblies = ReferenceAssemblies.Net.Net70, LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.Preview, }; - // TODO: remove when the type is available - test.TestState.Sources.Add(s_attributeSource); test.ExpectedDiagnostics.AddRange(diagnosticResults); await test.RunAsync(); } - private static readonly string s_attributeSource = @"#nullable enable -namespace System.Diagnostics.CodeAnalysis -{ - [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] - public sealed class ConstantExpectedAttribute : Attribute - { - public object? Min { get; set; } - public object? Max { get; set; } - } -}"; - private static async Task TestCSMissingAttributeAsync(string source, params DiagnosticResult[] diagnosticResults) { var test = new VerifyCS.Test