Exemple #1
0
        void IPact.Verify()
        {
            var matches = _handler.VerifyAndClose();

            if (matches != 1)
            {
                throw new Exception($"The pact was matched {matches} times. Expected one.");
            }
        }
Exemple #2
0
            int IVerifyAndClosable.VerifyAndClose(int expectedMatches)
            {
                var result = _inner.VerifyAndClose(expectedMatches);

                if (!_closed)
                {
                    _close(result == expectedMatches);
                    _closed = true;
                }
                return(result);
            }