-
Notifications
You must be signed in to change notification settings - Fork 1.6k
chore: add GlobalUsings.cs with project-wide using directives in data structures tests #526
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds a GlobalUsings.cs file with project-wide using directives and removes redundant using statements from test files across the DataStructures.Tests project. This modernizes the codebase to use C# 10+ global using features for better code organization and reduces repetitive using declarations.
- Added GlobalUsings.cs with commonly used namespaces declared globally
- Removed redundant using statements from all test files that are now covered by global usings
- Minor code formatting improvement in one test method
Reviewed Changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
DataStructures.Tests/GlobalUsings.cs | Introduces global using directives for common namespaces (System, NUnit.Framework, FluentAssertions, etc.) |
Multiple test files | Removes redundant using statements now covered by global usings |
DataStructures.Tests/Hashing/HashTableTests.cs | Minor formatting improvement to lambda expression |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
global using System.Linq; // LINQ query operators for collections | ||
global using System.Text; // Text encoding, StringBuilder, etc. | ||
global using NUnit.Framework; // Testing framework providing attributes and assertions for test cases | ||
global using NUnit.Framework.Internal; // Internal NUnit infrastructure (test context, utilities) — generally used for advanced or framework-level test control |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The NUnit.Framework.Internal namespace contains internal APIs that are not intended for public use and may change between versions. Consider removing this global using unless there's a specific need for internal NUnit functionality.
global using NUnit.Framework.Internal; // Internal NUnit infrastructure (test context, utilities) — generally used for advanced or framework-level test control |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the comments
global using NUnit.Framework; // Testing framework providing attributes and assertions for test cases | ||
global using NUnit.Framework.Internal; // Internal NUnit infrastructure (test context, utilities) — generally used for advanced or framework-level test control | ||
global using FluentAssertions; // Assertion library for more readable and expressive unit tests | ||
global using System.Collections; // Non-generic collection types (e.g., ArrayList, Hashtable, IDictionary, ICollection) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System.Collections contains legacy non-generic collection types that are generally discouraged in modern C# development. Consider removing this global using unless legacy collections are actively used throughout the test project.
global using System.Collections; // Non-generic collection types (e.g., ArrayList, Hashtable, IDictionary, ICollection) |
Copilot uses AI. Check for mistakes.
… structures tests
bed60ce
to
ba78eb4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #526 +/- ##
==========================================
- Coverage 95.19% 95.15% -0.04%
==========================================
Files 272 272
Lines 10920 10920
Branches 1536 1536
==========================================
- Hits 10395 10391 -4
- Misses 400 403 +3
- Partials 125 126 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-request a review when the comments are addressed
Description
This pull request contains the following changes
Issue link: #520