Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

From internal test team: 1 Warning occurs after creating a NUnit Test Project #493

Closed
arunchndr opened this issue Nov 22, 2022 · 3 comments

Comments

@arunchndr
Copy link

Moved over from https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1684963

Affected Build: 17.5.0 Preview 2.0 [33121.297.main]

More Info: 
1. It also reproduced in 17.3 and 17.4
2. It works fine on 16.11

Steps to reproduce:
1. Launch VS and Create a new NUnit Test Project
2. Observe the Error List

Expected Results: No error or warning in Error List

Actual Results: 1 Warning occurs after creating a NUnit Test Project

Image

Severity        Code        Description        Project        File        Line        Suppression State

Warning        AD0001        Analyzer 'NUnit.Analyzers.UseAssertMultiple.UseAssertMultipleAnalyzer' threw an exception of type 'System.IndexOutOfRangeException' with message 'Index was outside the bounds of the array.'.

Exception occurred with following context:

Compilation: TestProject2

IOperation: Invocation

SyntaxTree: C:\Users\CTITest\source\repos\TestProject2\TestProject2\UnitTest1.cs

SyntaxNode: Assert.Pass() [InvocationExpressionSyntax]@[196..209) (12,12)-(12,25)

 

System.IndexOutOfRangeException: Index was outside the bounds of the array.

   at NUnit.Analyzers.UseAssertMultiple.UseAssertMultipleAnalyzer.AnalyzeAssertInvocation(OperationAnalysisContext context, IInvocationOperation assertOperation)

   at NUnit.Analyzers.BaseAssertionAnalyzer.AnalyzeInvocation(OperationAnalysisContext context)

   at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c.<ExecuteOperationAction>b__63_0(ValueTuple`2 data)

   at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 info)

-----

 

Suppress the following diagnostics to disable this analyzer: NUnit2045        TestProject2                1        Active




11/22/2022 8:57 AM Bug filed on "[UI]Create Net Core Project"


@manfred-brands
Copy link
Member

This looks like a duplicate of #420. Can you upgrade to version 3.5.0 to see if the problem disappears?

@mikkelbu
Copy link
Member

If this is the right place - dotnet/test-templates#252 - then it seems like they are already updated. But I cannot tell when they will be available in VS

@mikkelbu
Copy link
Member

I'm closing this as I don't think we can do anything about, but wait on the templates to be updated/released.

@mikkelbu mikkelbu added this to the Closed Without Action milestone Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants