Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an extensibility/notification callback that fires when a mocked IPeriodicTimer is waiting for its next tick, aligning PeriodicTimer with the existing MockTimeSystem.On.* notification pattern.
Changes:
- Introduces
IPeriodicTimerNotificationHandlerand exposes it viaINotificationHandler.PeriodicTimer(feature-gated). - Wires
PeriodicTimerMock.WaitForNextTickAsyncto invoke the new notification viaNotificationHandler. - Adds test coverage for callback invocation, disposal behavior, multiple callbacks, and predicate filtering.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Testably.Abstractions.Testing.Tests/TimeSystem/PeriodicTimerMockTests.cs | Adds tests validating the callback behavior from the PeriodicTimerMock perspective. |
| Tests/Testably.Abstractions.Testing.Tests/TimeSystem/NotificationHandlerTests.cs | Adds tests validating notification registration/disposal, multiple callbacks, and predicate filtering. |
| Source/Testably.Abstractions.Testing/TimeSystem/PeriodicTimerMock.cs | Invokes notification when WaitForNextTickAsync is called; stores callback handler. |
| Source/Testably.Abstractions.Testing/TimeSystem/PeriodicTimerFactoryMock.cs | Passes the callback handler into created PeriodicTimerMock instances. |
| Source/Testably.Abstractions.Testing/TimeSystem/NotificationHandler.cs | Implements the new periodic-timer notification registration + invocation. |
| Source/Testably.Abstractions.Testing/TimeSystem/IPeriodicTimerNotificationHandler.cs | Adds the public interface describing the periodic timer notifications (feature-gated). |
| Source/Testably.Abstractions.Testing/TimeSystem/INotificationHandler.cs | Exposes PeriodicTimer notifications off MockTimeSystem.On (feature-gated). |
| Source/Testably.Abstractions.Testing/MockTimeSystem.cs | Wires NotificationHandler into the periodic timer factory so notifications can be raised. |
Source/Testably.Abstractions.Testing/TimeSystem/IPeriodicTimerNotificationHandler.cs
Outdated
Show resolved
Hide resolved
Source/Testably.Abstractions.Testing/TimeSystem/NotificationHandler.cs
Outdated
Show resolved
Hide resolved
|
|
This is addressed in release v6.2.0. |
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 an extensibility/notification callback that fires when a mocked
IPeriodicTimeris waiting for its next tick, aligningPeriodicTimerwith the existingMockTimeSystem.On.*notification pattern.Changes:
IPeriodicTimerNotificationHandlerand exposes it viaINotificationHandler.PeriodicTimer(feature-gated).PeriodicTimerMock.WaitForNextTickAsyncto invoke the new notification viaNotificationHandler.