예제 #1
0
        private bool TryVerifyAll(out MockException error)
        {
            foreach (Invocation invocation in this.MutableInvocations)
            {
                invocation.MarkAsVerifiedIfMatchedBySetup();
            }

            var uninvokedSetups = this.Setups.ToArrayLive(setup => !setup.TryVerifyAll());

            if (uninvokedSetups.Length > 0)
            {
                error = MockException.UnmatchedSetups(this, uninvokedSetups);
                return(false);
            }

            foreach (var inner in this.InnerMocks.Values)
            {
                if (!inner.Mock.TryVerifyAll(out error))
                {
                    return(false);
                }
            }

            error = null;
            return(true);
        }
예제 #2
0
파일: Mock.cs 프로젝트: tomchavakis/moq4
        private bool TryVerifyAll(out MockException error)
        {
            var uninvokedSetups = this.Setups.ToArrayLive(setup => !setup.Invoked);

            if (uninvokedSetups.Length > 0)
            {
                error = MockException.UnmatchedSetups(this, uninvokedSetups);
                return(false);
            }

            foreach (var inner in this.InnerMocks.Values)
            {
                if (!inner.Mock.TryVerifyAll(out error))
                {
                    return(false);
                }
            }

            error = null;
            return(true);
        }