Skip to content

Mas/jm 260/entire class futute mocking - #256

Open
MladenStankov wants to merge 3 commits into
developfrom
mas/jm-260/entire-class-futute-mocking
Open

Mas/jm 260/entire class futute mocking#256
MladenStankov wants to merge 3 commits into
developfrom
mas/jm-260/entire-class-futute-mocking

Conversation

@MladenStankov

@MladenStankov MladenStankov commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds Mock.SetupFuture overloads so tests can configure future mocking for all instance members of a target type.
  • Extends the future-mocking flow so those arrangements apply to intercepted instances created during the test.
  • Updates the SetupFuture XML documentation to clarify that constructor interception is included and to document the expected behavior guidance.
  • Part of Issue JM-260.

Testing

  • No automated test changes are included in this diff.

Checklist

  • Part of Issue JM-260
  • Adds or updates public API surface
  • Includes documentation updates
  • Includes automated test changes

MladenStankov and others added 3 commits August 31, 2026 14:11
- Add futureMixinDatabase field to MocksRepository
- Add InterceptFuture method mirroring InterceptStatics
- Modify GetMockMixin to check futureMixinDatabase for instance calls
- Add futureMixinDatabase.Clear() in Reset() for test isolation
- Create Mock.SetupFuture.cs with four overloads gated by #if !LITE_EDITION

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…lesale interception

Corrects the misleading 'Constructors are not intercepted' remark on all
four SetupFuture overloads. SetupFuture uses EnableInterception which applies
wholesale interception including constructors, consistent with SetupStatic.

- Update remarks on SetupFuture<T>() and SetupFuture<T>(Behavior) to accurately
  describe constructor interception behavior and guidance to use CallOriginal
  if constructor execution is required.
- Add <remarks> to the Type overloads (SetupFuture(Type) and SetupFuture(Type, Behavior))
  which previously had no remarks section at all.
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.

1 participant