void IPact.Verify() { var matches = _handler.VerifyAndClose(); if (matches != 1) { throw new Exception($"The pact was matched {matches} times. Expected one."); } }
int IVerifyAndClosable.VerifyAndClose(int expectedMatches) { var result = _inner.VerifyAndClose(expectedMatches); if (!_closed) { _close(result == expectedMatches); _closed = true; } return(result); }