Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 6, 2025

This PR adds an INetMQMonitor interface to allow mocking of NetMQMonitor in tests, similar to the existing INetMQSocket and INetMQPoller interfaces.

Changes Made

  1. Created INetMQMonitor interface (src/NetMQ/Monitoring/INetMQMonitor.cs) containing all public members of NetMQMonitor:

    • Properties: Endpoint, IsRunning, Timeout
    • Events: All monitoring events (Connected, Listening, Accepted, etc.)
    • Methods: AttachToPoller, DetachFromPoller, Start, StartAsync, Stop, Dispose
    • Documentation describes the abstraction: "Monitors a NetMQSocket for events, raising them via events"
  2. Updated NetMQMonitor to implement INetMQMonitor interface with <inheritdoc /> tags throughout to inherit documentation from the interface

  3. Deleted NuGet.Config file as it only contained the default NuGet.org package source and is no longer needed

Documentation

All XML documentation follows best practices:

  • Property docs start with "Gets" or "Gets and sets"
  • All summaries end with periods
  • Uses <see cref="..." /> when referring to symbols
  • No duplicate documentation between interface and implementation

Testing

  • ✅ Build succeeds with 0 warnings, 0 errors
  • ✅ All changes are non-breaking - existing code continues to work unchanged

Fixes #1137

Original prompt

This section details on the original issue you should resolve

<issue_title>There is no interface on the NetMQMonitor allowing us to mock it during testing</issue_title>
<issue_description>There are the interfaces INetMQSocket and INetMQPoller allowing us to mock them for testing but there isn't one for the monitor. Currently we have to create an adapter just to mock it, it'd be handy to have the interface. I'm happy to help implement it if required.</issue_description>

Comments on the Issue (you are @copilot in this section)

@drewnoakes Feel free to submit a PR! It should be possible to achieve this without breaking anyone.
Fixes #1137

💡 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.

Copilot AI and others added 3 commits October 6, 2025 02:21
Co-authored-by: drewnoakes <350947+drewnoakes@users.noreply.github.com>
Co-authored-by: drewnoakes <350947+drewnoakes@users.noreply.github.com>
Co-authored-by: drewnoakes <350947+drewnoakes@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] There is no interface on the NetMQMonitor allowing us to mock it during testing Add INetMQMonitor interface to enable mocking in tests Oct 6, 2025
@Copilot Copilot AI requested a review from drewnoakes October 6, 2025 02:27
Copilot finished work on behalf of drewnoakes October 6, 2025 02:27
@drewnoakes
Copy link
Member

@copilot PTAL

@drewnoakes
Copy link
Member

@djangohunt does this look good to you? Happy with the members on the interface?

…eedback

Co-authored-by: drewnoakes <350947+drewnoakes@users.noreply.github.com>
@Copilot Copilot AI requested a review from drewnoakes October 6, 2025 02:45
Copilot finished work on behalf of drewnoakes October 6, 2025 02:45
Copy link
Member

@drewnoakes drewnoakes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot please improve the docs as described.

…d periods, use cref, add inheritdoc

Co-authored-by: drewnoakes <350947+drewnoakes@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 6, 2025

@copilot please improve the docs as described.

Done in commit 9c4e6bf. All documentation improvements have been applied as described in the review comments.

Copilot finished work on behalf of drewnoakes October 6, 2025 02:56
@Copilot Copilot AI requested a review from drewnoakes October 6, 2025 02:56
…inheritdoc in NetMQMonitor

Co-authored-by: drewnoakes <350947+drewnoakes@users.noreply.github.com>
@Copilot Copilot AI requested a review from drewnoakes October 6, 2025 04:12
Copilot finished work on behalf of drewnoakes October 6, 2025 04:12
@drewnoakes drewnoakes marked this pull request as ready for review October 6, 2025 04:41
Co-authored-by: drewnoakes <350947+drewnoakes@users.noreply.github.com>
@Copilot Copilot AI requested a review from drewnoakes October 6, 2025 04:48
Copilot finished work on behalf of drewnoakes October 6, 2025 04:48
@drewnoakes drewnoakes merged commit b368be3 into master Oct 6, 2025
6 checks passed
@drewnoakes drewnoakes deleted the copilot/fix-22614b1b-62c1-406c-a361-9b624d35f396 branch October 6, 2025 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

There is no interface on the NetMQMonitor allowing us to mock it during testing

2 participants