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

Refactor Analyzer tests. #12822

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

KlausLoeffelmann
Copy link
Member

@KlausLoeffelmann KlausLoeffelmann commented Jan 22, 2025

Since we're expecting more Analyzers in the WinForms area coming also as community contribution, it makes sense to simplify and standardize the tests we have for Analyzers and CodeFixes.

This PR does the first step in that direction by doing a first refactoring pass of the Analyzer/CodeFixes tests.

Microsoft Reviewers: Open in CodeFlow


public static IEnumerable<object[]> GetReferenceAssemblies()
{
yield return [ReferenceAssemblies.Net.Net90Windows];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are NET10 assemblies still not available?

@@ -34,4 +34,22 @@
</None>
</ItemGroup>

<ItemGroup>
<Compile Remove="TestData\AvoidPassingTaskWithoutCancellationToken\AnalyzerTestCode.cs" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about calling this directory Data instead of TestData?

using Microsoft.CodeAnalysis.CSharp.Testing;
using Microsoft.CodeAnalysis.Testing;

namespace System.Windows.Forms.Analyzers.Test;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KlausLoeffelmann - please unify namespace names

Suggested change
namespace System.Windows.Forms.Analyzers.Test;
namespace System.Windows.Forms.Analyzers.Tests;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
draft draft PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants