Repository navigation
[Repo Assist] test: expand WindowsNodeClient coverage with 10 new unit tests - #157
Merged
shanselman merged 1 commit intoApr 8, 2026
Conversation
Adds tests for previously uncovered scenarios: - HandleResponse with stored device token fires Paired (not Pending) - HandleResponse with ok:false raises ConnectionStatus.Error - HandleResponse with missing payload does not throw - ShortDeviceId truncates to 16-char prefix of FullDeviceId - IsPaired returns false when no device token stored - IsPaired returns true after device token stored - RegisterCapability adds to Capabilities list and Registration - RegisterCapability deduplicates categories in NodeRegistration - IsPendingApproval is false initially - FullDeviceId is non-empty after construction Co-authored-by: Copilot <[email protected]>
shanselman
marked this pull request as ready for review
April 8, 2026 20:09
shanselman
deleted the
repo-assist/test-windows-node-client-20260408-3bc558375b39eebf
branch
April 8, 2026 20:09
12 tasks
9 of 16 tasks
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 was created by Repo Assist, an automated AI assistant.
Summary
WindowsNodeClientTests.cshad only 3 tests (2 Facts + 1 Theory with 3 inline cases) for a class with significant branching logic. This PR adds 10 new tests covering previously untested code paths.New test coverage
HandleResponse_HelloOkWithStoredToken_FiresPairedOnceNotPendinghello-okarrives, exactly onePairedevent fires (notPending → Paired)HandleResponse_FailedRegistration_RaisesConnectionErrorok: falsefrom gateway raisesConnectionStatus.ErrorHandleResponse_MissingPayload_DoesNotThrowpayloadproperty doesn't crashShortDeviceId_LongId_TruncatesTo16CharsIsPaired_ReturnsFalse_WhenNoStoredTokenIsPaired = falseIsPaired_ReturnsTrue_AfterDeviceTokenStoredStoreDeviceToken,IsPaired = trueRegisterCapability_AddsToCapabilitiesListAndRegistrationclient.CapabilitiesRegisterCapability_DeduplicatesCommandsAndCategoriesNodeRegistrationIsPendingApproval_FalseInitiallyFullDeviceId_IsNonEmptyFullDeviceIdis non-empty after constructionTest Status
All 10 new tests pass. No existing tests broken.