Closed
Add comprehensive unit tests for extension classes#191
Conversation
Copilot
AI
changed the title
[WIP] Add Unit Tests for Extension Classes
Add comprehensive unit tests for extension classes
Aug 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds comprehensive unit test coverage for all extension classes in the WinUI.TableView library, addressing the need for proper validation of extension method functionality.
📋 What's Added
Test Infrastructure
WinUI.TableView.Tests) with proper project referencesInternalsVisibleToattribute to enable testing of internal extension methodsExtension Classes Covered
ObjectExtensions - Tests for object manipulation and reflection methods:
IsNumeric()- Validates numeric type detection for all numeric typesGetItemType()- Tests enumerable type inference for generic/non-generic collectionsGetCustomOrCLRType()- Verifies type resolution including custom type providersGetValue()- Complex property path navigation with arrays, lists, and nested objectsTypeExtensions - Comprehensive type checking and utility methods:
IsBoolean(),IsNumeric(),IsDateTime(),IsTimeSpan(),IsDateOnly(),IsTimeOnly(),IsDateTimeOffset()IsNullableType(),GetNonNullableType()IsPrimitive(),IsInheritedFromIComparable()GetEnumerableItemType(),IsEnumerableType()CollectionExtensions - Collection manipulation methods:
AddRange<T>()- Bulk addition to collections with various source typesRemoveWhere<T>()- Predicate-based removal with complex filtering scenariosDateTimeExtensions - Date/time conversion utilities:
ToDateTimeOffset()overloads forDateTime,TimeSpan,DateOnly,TimeOnlyItemIndexRangeExtensions - Range validation for WinUI controls:
IsInRange()- Index boundary checkingIsValid()- TableView context validationTableViewCellSlotExtensions - Cell position validation:
IsValidRow(),IsValidColumn(),IsValid()- Position validation within TableView bounds🧪 Test Coverage Details
[Theory]and[InlineData]for comprehensive parameterized testing🔧 Technical Implementation
The tests provide robust validation ensuring the extension methods handle all documented scenarios correctly, including proper error handling and edge case management as requested in the issue requirements.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
crl.godaddy.comdotnet build --verbosity minimal(dns block)ocsp.godaddy.comdotnet build --verbosity minimal(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.