Skip to content

Comments

Document interaction tracking features#436

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/add-interaction-tracking-docs
Closed

Document interaction tracking features#436
Copilot wants to merge 2 commits intomainfrom
copilot/add-interaction-tracking-docs

Conversation

Copy link
Contributor

Copilot AI commented Jan 31, 2026

Interaction tracking APIs (.Interactions, .ClearAllInteractions(), and MockMonitor) were undocumented.

Changes

  • README.md: Added "Interaction Tracking" section after "Verify interactions"
  • Docs/pages/05-interaction-tracking.md: New dedicated page for interaction tracking
  • Tests/Mockolate.ExampleTests: Added working examples demonstrating the APIs

Usage

Access all interactions:

var sut = Mock.Create<IChocolateDispenser>();
sut.Dispense("Dark", 5);

Mock<IChocolateDispenser> mockInstance = ((IMockSubject<IChocolateDispenser>)sut).Mock;
foreach (var interaction in mockInstance.Interactions.Interactions)
{
    Console.WriteLine($"Interaction: {interaction}");
}

sut.SetupMock.ClearAllInteractions();

Monitor scoped interactions:

using (var monitor = sut.MonitorMock(out MockMonitor<IChocolateDispenser> monitorInstance))
{
    sut.Dispense("Dark", 5);
    monitorInstance.Verify.Invoked.Dispense(It.Is("Dark"), It.Is(5)).Once();
}
Original prompt

This section details on the original issue you should resolve

<issue_title>Document interaction tracking features</issue_title>
<issue_description>## Description

Interaction tracking features are completely undocumented.

Missing Documentation

  • .Interactions property - Access all recorded interactions
  • .ClearAllInteractions() - Clear interaction history
  • MockMonitor.Run() - Session-based monitoring

Suggested Documentation

Add a new section titled "Interaction Tracking":

### Interaction Tracking

Mockolate tracks all interactions with mocks. You can access and manage these interactions:

```csharp
var sut = Mock.Create<IChocolateDispenser>();

sut.Dispense(\"Dark\", 5);
sut.Dispense(\"Milk\", 3);

// Access all interactions
foreach (var interaction in sut.Interactions)
{
    Console.WriteLine($\"Interaction: {interaction}\");
}

// Clear interaction history
sut.ClearAllInteractions();

Mock Monitoring Sessions

Use MockMonitor.Run() to track interactions within a specific scope:

using (var monitor = MockMonitor.Run())
{
    sut.Dispense(\"Dark\", 5);
    
    // Access interactions within this session
    var interactions = monitor.GetInteractions();
}

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

<comments>
</comments>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: vbreuss <3438234+vbreuss@users.noreply.github.com>
Copilot AI changed the title [WIP] Add documentation for interaction tracking features Document interaction tracking features Jan 31, 2026
Copilot AI requested a review from vbreuss January 31, 2026 09:25
@vbreuss
Copy link
Contributor

vbreuss commented Jan 31, 2026

Obsolete by #441

@vbreuss vbreuss closed this Jan 31, 2026
@vbreuss vbreuss deleted the copilot/add-interaction-tracking-docs branch February 5, 2026 17:04
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.

Document interaction tracking features

2 participants