Repository navigation
[Test] Cover message bus cleanup, Listen consumer, token refresh retry and async session asserts; fixes #406, #407, #408, #409 - #413
Merged
Conversation
…y and async session asserts; fixes #406, #407, #408, #409 - MessageBusTestFixture: disposing the last subscription removes the observable; resubscribing after dispose receives messages (#406) - ThingMessageConsumerListenTestFixture: Listen pushes messages, reports shutdown as OperationCanceledException, detaches handlers on dispose (#407) - AutomaticTokenRefreshServiceTestFixture: StartAsync retries a refresh after a transient failure (#408) - SessionServiceTestFixtures: VerifyOpenSession awaits its async asserts (#409) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.



Prerequisites
Description
Adds tests for four coverage gaps. Only test code changes.
MessageBusTestFixture(net48 and net10.0): disposing the last subscription removes the observable from the bus, and subscribing again after a dispose still receives messages.ThingMessageConsumerListenTestFixture:Listenpushes a received message to the subscriber, reports a consumer shutdown asOperationCanceledException(with reply code and text), and detaches its handlers when the subscription is disposed. This is a separate fixture becauseThingMessageConsumerTestFixtureshares its mocks across tests, and its existing invocation-count asserts depend on that. The new fixture creates fresh channel and serializer mocks for each test.AutomaticTokenRefreshServiceTestFixture(net48 and net10.0):StartAsyncretries a refresh after a transient failure and then completes the refresh once. It takes about 5 s.SessionServiceTestFixtures.VerifyOpenSessionnow awaits its async asserts (Assert.MultipleAsync,Assert.ThatAsync). It isWebServicesDependent; I ran it locally against the public COMET server, and it passes.Each new test was checked by breaking the code it guards and confirming that the test fails.
Verification on top of #410 (NUnit 5): build has 0 errors; 2,454 tests pass and 0 fail, with the CI filter.
While writing the #408 test, I found two bugs in
AuthenticationTokenRefreshService. They are filed as #411 and #412 and are not fixed here.Closes #406, closes #407, closes #408, closes #409
🤖 Generated with Claude Code