You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Analyzer 'NUnit.Analyzers.DisposeFieldsInTearDown.DisposeFieldsAndPropertiesInTearDownAnalyzer' threw an exception of type 'System.ArgumentException' with message 'Syntax node is not within syntax tree'
1> SyntaxNode: public partial class TestFixture ... [ClassDeclarationSyntax]@[17..158) (2,0)-(8,1)
1> System.ArgumentException: Syntax node is not within syntax tree
1> at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.CheckSyntaxNode(CSharpSyntaxNode syntax)
1> at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.GetSymbolInfo(ExpressionSyntax expression, CancellationToken cancellationToken)
1> at Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetSymbolInfo(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken)
1> at NUnit.Analyzers.DisposeFieldsInTearDown.DisposeFieldsAndPropertiesInTearDownAnalyzer.Parameters.IsLocalMethodCall(InvocationExpressionSyntax invocationExpression, IMethodSymbol& calledMethod)
1> at NUnit.Analyzers.DisposeFieldsInTearDown.DisposeFieldsAndPropertiesInTearDownAnalyzer.AssignedIn(Parameters parameters, HashSet`1 assignments, ExpressionSyntax expression)
1> at NUnit.Analyzers.DisposeFieldsInTearDown.DisposeFieldsAndPropertiesInTearDownAnalyzer.AssignedIn(Parameters parameters, HashSet`1 assignments, SyntaxList`1 statements)
1> at NUnit.Analyzers.DisposeFieldsInTearDown.DisposeFieldsAndPropertiesInTearDownAnalyzer.AssignedIn(Parameters parameters, HashSet`1 assignments, BaseMethodDeclarationSyntax method)
1> at NUnit.Analyzers.DisposeFieldsInTearDown.DisposeFieldsAndPropertiesInTearDownAnalyzer.AssignedIn(Parameters parameters, HashSet`1 assignments, IMethodSymbol symbol)
1> at NUnit.Analyzers.DisposeFieldsInTearDown.DisposeFieldsAndPropertiesInTearDownAnalyzer.AssignedIn(Parameters parameters, HashSet`1 assignments, IEnumerable`1 methods)
1> at NUnit.Analyzers.DisposeFieldsInTearDown.DisposeFieldsAndPropertiesInTearDownAnalyzer.AnalyzeAssignedButNotDisposed(SyntaxNodeAnalysisContext context, Dictionary`2 symbols, Parameters parameters, String where, IEnumerable`1 setUpMethods, IEnumerable`1 tearDownMethods, HashSet`1 assignedWithInitializers)
1> at NUnit.Analyzers.DisposeFieldsInTearDown.DisposeFieldsAndPropertiesInTearDownAnalyzer.AnalyzeDisposableFields(SyntaxNodeAnalysisContext context)
1> at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__49`1.<ExecuteSyntaxNodeAction>b__49_0(ValueTuple`2 data)
1> at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 info, CancellationToken cancellationToken)
NUnit: 3.14.0
NUnit.Analyzers: 3.9.0
using System;publicpartialclassTestFixture{privatestaticobjectProperty{get=>thrownew NotImplementedException();}}
using NUnit.Framework;using System;publicpartialclassTestFixture{[Test]publicvoidSomeTest(){
SomeAsserts();}privatestaticvoidSomeAsserts()=>thrownew InvalidOperationException();}
The text was updated successfully, but these errors were encountered:
Thanks @MaceWindu for the report.
I never used partial classes with nunit tests.
It looks as if it tries to find a symbol which is defined in the other partial part.
I have no access to a PC this weekend, but will look into this next week.
NUnit: 3.14.0
NUnit.Analyzers: 3.9.0
The text was updated successfully, but these errors were encountered: