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

Enhanced FastSearcherTests with additional test cases #501

Conversation

gmottajr
Copy link
Contributor

@gmottajr gmottajr commented Dec 6, 2024

Enhanced FastSearcherTests with additional test cases and improved assertions using FluentAssertions.

Introduced new test cases to cover additional scenarios:

  •     FindIndex_ItemPresentInArrayOfDuplicates_IndexCorrect: Verifies correct behavior when searching for an item in an array with all duplicate values.
    
  •     FindIndex_ItemMissingInArrayOfDuplicates_ItemNotFoundExceptionThrown: Ensures an exception is thrown when searching for an absent item in an array of duplicates.
    
  •     FindIndex_ItemOutOfRange_ItemNotFoundExceptionThrown: Confirms exceptions are raised for items smaller or larger than the array's range.
    

    Replaced NUnit's traditional Assert syntax with FluentAssertions for:

      Improved readability.
      Consistent assertion style.
      Expressive exception validation using act.Should().Throw<Exception>().
    

Maintained edge case validation for empty arrays, out-of-range values, and general functionality.

These updates refine test clarity, improve maintainability, and ensure comprehensive coverage of the FastSearcher class.

  • 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

…sertions using FluentAssertions.

    Introduced new test cases to cover additional scenarios:
        FindIndex_ItemPresentInArrayOfDuplicates_IndexCorrect: Verifies correct behavior when searching for an item in an array with all duplicate values.
        FindIndex_ItemMissingInArrayOfDuplicates_ItemNotFoundExceptionThrown: Ensures an exception is thrown when searching for an absent item in an array of duplicates.
        FindIndex_ItemOutOfRange_ItemNotFoundExceptionThrown: Confirms exceptions are raised for items smaller or larger than the array's range.

    Replaced NUnit's traditional Assert syntax with FluentAssertions for:
        Improved readability.
        Consistent assertion style.
        Expressive exception validation using act.Should().Throw<Exception>().

    Maintained edge case validation for empty arrays, out-of-range values, and general functionality.

These updates refine test clarity, improve maintainability, and ensure comprehensive coverage of the FastSearcher class.
@gmottajr gmottajr requested a review from siriak as a code owner December 6, 2024 03:38
Copy link

codecov bot commented Dec 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.16%. Comparing base (046f26e) to head (f94da60).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #501   +/-   ##
=======================================
  Coverage   95.16%   95.16%           
=======================================
  Files         267      267           
  Lines       10848    10848           
  Branches     1527     1527           
=======================================
  Hits        10323    10323           
  Misses        400      400           
  Partials      125      125           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Looks good, thanks!

@siriak siriak merged commit 2ed7a7b into TheAlgorithms:master Dec 6, 2024
4 checks passed
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