diff --git a/src/nunit.analyzers/BaseAssertionAnalyzer.cs b/src/nunit.analyzers/BaseAssertionAnalyzer.cs index 82f0e5b6..503caf87 100644 --- a/src/nunit.analyzers/BaseAssertionAnalyzer.cs +++ b/src/nunit.analyzers/BaseAssertionAnalyzer.cs @@ -4,6 +4,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Operations; +using NUnit.Analyzers.Constants; using NUnit.Analyzers.Extensions; namespace NUnit.Analyzers @@ -50,7 +51,8 @@ private void AnalyzeCompilationStart(CompilationStartAnalysisContext context) { IEnumerable referencedAssemblies = context.Compilation.ReferencedAssemblyNames; - AssemblyIdentity? nunit = referencedAssemblies.SingleOrDefault(a => a.Name.Equals("nunit.framework", StringComparison.OrdinalIgnoreCase)); + AssemblyIdentity? nunit = referencedAssemblies.FirstOrDefault(a => + a.Name.Equals(NUnitFrameworkConstants.NUnitFrameworkAssemblyName, StringComparison.OrdinalIgnoreCase)); if (nunit is null) {