feat: Introduce NetEvolve.Pulse.Testing — FakeMediator for unit testing#157
Draft
feat: Introduce NetEvolve.Pulse.Testing — FakeMediator for unit testing#157
NetEvolve.Pulse.Testing — FakeMediator for unit testing#157Conversation
8 tasks
Introduces a new testing support package that provides a lightweight FakeMediator implementation for unit testing scenarios. - FakeMediator implements IMediator fully - SetupCommand/SetupQuery with fluent Returns()/Throws() builder - SetupEvent for event capture - Verify<T>(times) for invocation count assertions - GetPublishedEvents<T>() for captured events - Thread-safe implementation using ConcurrentDictionary - 21 comprehensive unit tests across net8.0/net9.0/net10.0 Agent-Logs-Url: https://github.com/dailydevops/pulse/sessions/c0a8ee2f-68c0-4dca-b307-12af53b9a5f9 Co-authored-by: samtrion <3283596+samtrion@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add NetEvolve.Pulse.Testing with FakeMediator for unit testing
feat: Introduce Mar 28, 2026
NetEvolve.Pulse.Testing — FakeMediator for unit testing
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.
Lightweight fake
IMediatorimplementation for unit testing without a DI container.New package:
NetEvolve.Pulse.TestingFakeMediator : IMediator— thread-safe (backed byConcurrentDictionary), zero dependencies beyondNetEvolve.Pulse.ExtensibilityRequestSetup<TResponse>— fluent builder returned bySetupCommand/SetupQuerywith.Returns(value)and.Throws(ex)/.Throws<T>()SetupEvent<TEvent>()— captures published events for later retrievalVerify<T>(int times)— asserts invocation count, throws descriptiveInvalidOperationExceptionon mismatchGetPublishedEvents<TEvent>()— returns captured events in publication orderInvalidOperationExceptionwith actionable messageTests
NetEvolve.Pulse.Testing.Tests.Unitcovering all public API surface acrossnet8.0,net9.0,net10.0Usage
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.