Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/Controls/tests/TestCases.HostApp/TestCases.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,24 @@ public class TestCaseScreen : CollectionView
{
public static Dictionary<string, Action> PageToAction = new Dictionary<string, Action>(StringComparer.OrdinalIgnoreCase);

[UnconditionalSuppressMessage("TrimAnalysis", "IL2112",
Justification = "TestCaseScreen fields are not accessed via reflection in NativeAOT builds since reflection-based test discovery is disabled.")]
bool _filterBugzilla;

[UnconditionalSuppressMessage("TrimAnalysis", "IL2112",
Justification = "TestCaseScreen fields are not accessed via reflection in NativeAOT builds since reflection-based test discovery is disabled.")]
bool _filterNone;

[UnconditionalSuppressMessage("TrimAnalysis", "IL2112",
Justification = "TestCaseScreen fields are not accessed via reflection in NativeAOT builds since reflection-based test discovery is disabled.")]
bool _filterGitHub;

[UnconditionalSuppressMessage("TrimAnalysis", "IL2112",
Justification = "TestCaseScreen fields are not accessed via reflection in NativeAOT builds since reflection-based test discovery is disabled.")]
bool _filterManual;

[UnconditionalSuppressMessage("TrimAnalysis", "IL2112",
Justification = "TestCaseScreen fields are not accessed via reflection in NativeAOT builds since reflection-based test discovery is disabled.")]
string _filter;

Copilot AI Aug 19, 2025

Copy link

Choose a reason for hiding this comment

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

The same UnconditionalSuppressMessage attribute is repeated 5 times with identical parameters. Consider extracting this into a constant or applying it at the class level if possible, or create a custom attribute to reduce duplication and improve maintainability.

Copilot uses AI. Check for mistakes.

void CheckInternetAndLoadPage(Type type)
Expand Down Expand Up @@ -88,6 +102,8 @@ Action ActivatePageAndNavigate(IssueAttribute issueAttribute, Type type)
return navigationAction;
}

[UnconditionalSuppressMessage("TrimAnalysis", "IL2026",
Justification = "ActivatePage method is only called in non-NativeAOT builds where reflection-based test discovery is enabled.")]
Page ActivatePage([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type type)
{
var page = Activator.CreateInstance(type) as Page;
Expand Down Expand Up @@ -136,6 +152,8 @@ public bool Matches(string filter)
}
}

[UnconditionalSuppressMessage("TrimAnalysis", "IL2112",
Justification = "TestCaseScreen fields are not accessed via reflection in NativeAOT builds since reflection-based test discovery is disabled.")]
readonly List<IssueModel> _issues;

void VerifyNoDuplicates()
Expand Down Expand Up @@ -322,6 +340,8 @@ from issueModel in _issues
ItemsSource = issues;
}

[UnconditionalSuppressMessage("TrimAnalysis", "IL2112",
Justification = "TestCaseScreen fields are not accessed via reflection in NativeAOT builds since reflection-based test discovery is disabled.")]
HashSet<string> _exemptNames = new HashSet<string> { };

// Legacy reasons, do not add to this list
Expand Down
Loading