Ejemplo n.º 1
0
 public override void Context()
 {
     base.Context();
     _callSpecForAnyArgs    = mock <ICallSpecification>();
     _lastCallSpecification = mock <ICallSpecification>();
     _pendingSpecification.stub(x => x.HasPendingCallSpec()).Return(true);
     _pendingSpecification.stub(x => x.UseCallSpec()).Return(_lastCallSpecification);
     _lastCallSpecification.stub(x => x.CreateCopyThatMatchesAnyArguments()).Return(_callSpecForAnyArgs);
 }
 public override void Context()
 {
     _context                  = mock <ISubstitutionContext>();
     _receivedCalls            = mock <IReceivedCalls>();
     _call                     = mock <ICall>();
     _callSpecFromCall         = mock <ICallSpecification>();
     _callSpecificationFactory = mock <ICallSpecificationFactory>();
     _exceptionThrower         = new FakeExceptionThrower();
     _callSpecFromCall.stub(x => x.IsSatisfiedBy(_call)).Return(true);
     _callSpecificationFactory.stub(x => x.CreateFrom(_call, _argMatching)).Return(_callSpecFromCall);
 }
Ejemplo n.º 3
0
            public override void Context()
            {
                base.Context();
                _call = mock <ICall>();
                _callSpecification = mock <ICallSpecification>();
                _callSpecification.stub(x => x.IsSatisfiedBy(_call)).Return(true);

                var callInfo = StubCallInfoForCall(_call);

                _resultToReturn = mock <IReturn>();
                _resultToReturn.stub(x => x.ReturnFor(callInfo)).Return(_expectedResult);
            }
Ejemplo n.º 4
0
            public override void Context()
            {
                base.Context();
                _callSpecification = mock <ICallSpecification>();
                _call = mock <ICall>();
                _callSpecification.stub(x => x.IsSatisfiedBy(_call)).Return(true);
                var callInfo = StubCallInfoForCall(_call);

                _returnOriginalResult = mock <IReturn>();
                _returnOriginalResult.stub(x => x.ReturnFor(callInfo)).Return(_originalResult);
                _returnOverriddenResult = mock <IReturn>();
                _returnOverriddenResult.stub(x => x.ReturnFor(callInfo)).Return(_overriddenResult);
            }
            public override void Context()
            {
                base.Context();
                _callSpecWithAnyArguments = mock <ICallSpecification>();
                _callSpecificationFactory.stub(x => x.CreateFrom(_call, MatchArgs.Any)).Return(_callSpecWithAnyArguments);

                _quantity                = Quantity.Exactly(2);
                _matchingCalls           = new[] { _call };
                _relatedNonMatchingCalls = new[] { mock <ICall>() };
                var completelyNonMatchingCalls = new[] { mock <ICall>() };

                Array.ForEach(_relatedNonMatchingCalls, call => _callSpecWithAnyArguments.stub(x => x.IsSatisfiedBy(call)).Return(true));

                var allRelatedCalls = _matchingCalls.Concat(_relatedNonMatchingCalls).Concat(completelyNonMatchingCalls);

                _receivedCalls.stub(x => x.AllCalls()).Return(allRelatedCalls);
            }