Skip to content

Revert: Changes were made in the wrong repository#97

Closed
Copilot wants to merge 4 commits intomainfrom
copilot/fix-haveallrequestscalled-mocks
Closed

Revert: Changes were made in the wrong repository#97
Copilot wants to merge 4 commits intomainfrom
copilot/fix-haveallrequestscalled-mocks

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

The changes intended to implement Should().HaveAllRequestsCalled() with detailed failure messages were made in the wrong repository (dennisdoomen/mockly). The correct repository is dennisdoomen/fluentassertions.mockly, which already contains the FluentAssertions extension packages for Mockly.

Changes

All previously introduced changes have been reverted:

  • Removed the new FluentAssertions.Mockly.v8 project that was incorrectly added to this repo
  • Restored Mockly.Specs to its original state (removed the project reference, new test class, and using directive)
  • Restored MvpIntegrationSpecs.cs to its original state
  • Restored HttpResponseMessageAssertions.cs to its original state
  • Restored Mockly.sln to its original state

The actual fix — improving the HaveAllRequestsCalled() failure message in Shared/HttpMockAssertionExtensions.cs to list each uninvoked mock by name — needs to be applied in the dennisdoomen/fluentassertions.mockly repository.

Copilot AI and others added 2 commits April 17, 2026 13:12
…ing uninvoked mocks

Agent-Logs-Url: https://github.com/dennisdoomen/mockly/sessions/22318e7b-74d6-4c4f-b275-d91a7e096666

Co-authored-by: dennisdoomen <572734+dennisdoomen@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix HaveAllRequestsCalled to list uncalled mocks Implement Should().HaveAllRequestsCalled() with detailed failure messages Apr 17, 2026
Copilot AI requested a review from dennisdoomen April 17, 2026 13:17
@dennisdoomen
Copy link
Copy Markdown
Owner

@copilot This was fixed in the wrong repo. The correct repo is https://github.com/dennisdoomen/fluentassertions.mockly. Can you fix this.

…ions.mockly

Agent-Logs-Url: https://github.com/dennisdoomen/mockly/sessions/9de336f1-352a-4323-b637-efeca03c50e2

Co-authored-by: dennisdoomen <572734+dennisdoomen@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 17, 2026

@copilot This was fixed in the wrong repo. The correct repo is https://github.com/dennisdoomen/fluentassertions.mockly. Can you fix this.

I've reverted all changes from this repo (commit db1ea01).

Unfortunately, I can only work in the repository that's cloned in my environment (dennisdoomen/mockly). I'm unable to push directly to dennisdoomen/fluentassertions.mockly.

The fix needed is in Shared/HttpMockAssertionExtensions.cs in the fluentassertions.mockly repo. The HaveAllRequestsCalled() method currently only reports the count of uninvoked mocks — it needs to list them. Here's the change:

public AndConstraint<HttpMockAssertions> HaveAllRequestsCalled(string because = "", params object[] becauseArgs)
{
    IReadOnlyList<RequestMock> uninvokedMocks = subject.GetUninvokedMocks().ToList();

    var failureMessage = new StringBuilder();
    failureMessage.AppendLine(
        "all request mocks should have been called{reason}, but the following mock(s) were not called (enough):");

    foreach (RequestMock mock in uninvokedMocks)
    {
        failureMessage.Append("  - ");
        failureMessage.Append(mock.ToString());

        if (mock.MaxInvocations is not null)
        {
            failureMessage.Append(
                $" (expected {mock.MaxInvocations} call(s), but was called {mock.InvocationCount} time(s))");
        }
        else
        {
            failureMessage.Append(" (was never called)");
        }

        failureMessage.AppendLine();
    }

#if FA8
    AssertionChain.GetOrCreate()
#else
    Execute.Assertion
#endif
        .BecauseOf(because, becauseArgs)
        .ForCondition(uninvokedMocks.Count == 0)
        .FailWith(failureMessage.ToString());

    return new AndConstraint<HttpMockAssertions>(this);
}

The test in Specs/AssertionSpecs.cs (Will_throw_when_not_all_mocks_have_been_invoked) also needs to be updated to check for the listed mock names instead of the count message. Could you reassign this issue to the fluentassertions.mockly repo so I can apply it there?

Copilot AI changed the title Implement Should().HaveAllRequestsCalled() with detailed failure messages Revert: Changes were made in the wrong repository Apr 17, 2026
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 24567039559

Coverage increased (+1.0%) to 84.604%

Details

  • Coverage increased (+1.0%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1047
Covered Lines: 940
Line Coverage: 89.78%
Relevant Branches: 317
Covered Branches: 214
Branch Coverage: 67.51%
Branches in Coverage %: Yes
Coverage Strength: 325.47 hits per line

💛 - Coveralls

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.

3 participants