Fix metadata names that could never resolve in MA0003, MA0001 and MA0060
Three GetBestTypeByMetadataName calls used metadata names that can never resolve, so the logic depending on them was dead.
MA0003 – System.Collection.Generic.KeyValuePair2` typo
The name is fixed to System.Collections.Generic.KeyValuePair2. The variable was also never used: it was added in 2018 (7b9b4054) with the Reflection/Assertexclusions, but the check itself was never written. This PR adds the intended exclusion fornew KeyValuePair<TKey, TValue>(key, value), since naming these arguments adds nothing, and documents it in MA0003.md`.
Behavior change: new KeyValuePair<string, object>("key", null) is no longer reported. KeyValuePair.Create(...) is on a different type and is unchanged.
MA0001 / MA0074 – XUnit.Assert → Xunit.Assert
Metadata names are case-sensitive, so xunit Assert methods were never treated as non-culture-sensitive.
Behavior change: calls such as Assert.Contains("a", "abc") now report MA0001 (info) instead of MA0074 (warning). This matches the other exempted types (JObject, Meziantou.Framework.Assertions.Assert).
MA0060 – remove the ImmutableArray1.Builder` fallback
This is not a valid metadata name, because nested types use +. The ImmutableArray1+Builder` lookup already resolves, so there is no behavior change.
Tests
NamedParameterAnalyzerTests.KeyValuePairCtor_ShouldNotReportDiagnosticUseStringComparisonAnalyzerTests.XunitAssert_ShouldNotReportCultureSensitiveDiagnosticDoNotIgnoreReturnValueAnalyzerTests.ImmutableArrayBuilder_LastIndexOf_ReturnValueNotUsed
With the source fixes reverted, the first two tests fail (MA0003 is reported, and MA0074 is reported instead of MA0001). The test classes for the three rules pass on roslyn5.9 and roslyn4.8. The analyzer builds for roslyn4.14, 5.0 and 5.6. dotnet run --project src/DocumentationGenerator leaves nothing to change.
Also noticed, not changed here: propertyBuilderType in NamedParameterAnalyzer is also unused.