From 5295af8815eb176f8687114ddf7d1cf0a2ed7aed Mon Sep 17 00:00:00 2001 From: stakx Date: Sat, 28 Mar 2020 15:06:43 +0100 Subject: [PATCH] Add XML doc comments for setup verification --- src/Moq/Setup.cs | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/Moq/Setup.cs b/src/Moq/Setup.cs index a50f49bc3..ec4d5a31e 100644 --- a/src/Moq/Setup.cs +++ b/src/Moq/Setup.cs @@ -89,6 +89,20 @@ public override string ToString() return builder.ToString(); } + /// + /// Verifies this setup and/or those of its inner mock (if present and known). + /// + /// + /// Specifies which setups should be verified. + /// + /// + /// If this setup and/or any of its inner mock (if present and known) failed verification, + /// this parameter will receive a describing the verification error(s). + /// + /// + /// if this setup and/or any of its inner mock (if present and known) did not fail verification; + /// otherwise, . + /// public bool TryVerify(Func predicate, out MockException error) { if (predicate(this)) @@ -103,6 +117,21 @@ public bool TryVerify(Func predicate, out MockException error) return this.TryVerifyInnerMock(predicate, out error); } + /// + /// Verifies all setups of this setup's inner mock (if present and known). + /// Multiple verification errors are aggregated into a single . + /// + /// + /// Specifies which setups should be verified. + /// + /// + /// If one or more setups of this setup's inner mock (if present and known) failed verification, + /// this parameter will receive a describing the verification error(s). + /// + /// + /// if no setup of this setup's inner mock (if present and known) failed verification; + /// otherwise, . + /// protected virtual bool TryVerifyInnerMock(Func predicate, out MockException error) { if (this.ReturnsInnerMock(out var innerMock)) @@ -118,6 +147,17 @@ protected virtual bool TryVerifyInnerMock(Func predicate, out MockE return true; } + /// + /// Verifies only this setup, excluding those of its inner mock (if present and known). + /// + /// + /// If this setup failed verification, + /// this parameter will receive a describing the verification error. + /// + /// + /// if this setup did not fail verification; + /// otherwise, . + /// protected virtual bool TryVerifySelf(out MockException error) { error = null;