Skip to content

Conversation

KaranChadha10
Copy link
Contributor

Description

This pull request contains the following changes

  • Converted block-scoped namespaces to file-scoped namespaces for consistency in Data Structures Tests folder
  • Removed redundant/unused global using directives to improve code clarity
  • Aligned code formatting with project conventions and C# 10+ style guidelines

Issue link: #520

  • I have performed a self-review of my code
  • My code follows the style guidelines of this project
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Comments in areas I changed are up to date
  • I have added comments to hard-to-understand areas of my code
  • I have made corresponding changes to the README.md

@siriak siriak requested a review from Copilot September 18, 2025 10:01
Copy link

@Copilot Copilot AI left a 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
Copy link
Preview

Copilot AI Sep 18, 2025

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.

Suggested change
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.

Copy link
Member

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)
Copy link
Preview

Copilot AI Sep 18, 2025

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.

Suggested change
global using System.Collections; // Non-generic collection types (e.g., ArrayList, Hashtable, IDictionary, ICollection)

Copilot uses AI. Check for mistakes.

@KaranChadha10 KaranChadha10 force-pushed the globalUsing-datastructures-tests/issue-520 branch from bed60ce to ba78eb4 Compare September 18, 2025 13:01
Copy link

codecov bot commented Sep 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.15%. Comparing base (f1fde96) to head (ba78eb4).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@siriak siriak left a 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

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

Successfully merging this pull request may close these issues.

2 participants