public override void Context()
 {
     base.Context();
     ConfigureCall = mock <IConfigureCall>();
     _call         = mock <ICall>();
     _call.stub(x => x.GetReturnType()).Return(_type);
     _firstAutoValueProvider  = mock <IAutoValueProvider>();
     _secondAutoValueProvider = mock <IAutoValueProvider>();
 }
示例#2
0
        public CallRouter(ISubstituteState substituteState, ISubstitutionContext context, IRouteFactory routeFactory)
        {
            _substituteState = substituteState;
            _context = context;
            _routeFactory = routeFactory;
            _receivedCalls = substituteState.ReceivedCalls;
            ConfigureCall = substituteState.ConfigureCall;

            UseDefaultRouteForNextCall();
        }
示例#3
0
        public CallRouter(ISubstituteState substituteState, ISubstitutionContext context, IRouteFactory routeFactory)
        {
            _substituteState = substituteState;
            _context         = context;
            _routeFactory    = routeFactory;
            _receivedCalls   = substituteState.ReceivedCalls;
            ConfigureCall    = substituteState.ConfigureCall;

            UseDefaultRouteForNextCall();
        }
示例#4
0
            public override void Context()
            {
                _propertyHelper = mock <IPropertyHelper>();
                ConfigureCall   = mock <IConfigureCall>();
                _call           = mock <ICall>();
                _propertyGetter = mock <ICall>();

                var settersWithMultipleArgsLikeIndexersHaveSetValueAsLastInArray = new[] { new object(), new object(), _setValue };

                _call.stub(x => x.GetArguments()).Return(settersWithMultipleArgsLikeIndexersHaveSetValueAsLastInArray);
                _propertyHelper.stub(x => x.CreateCallToPropertyGetterFromSetterCall(_call)).Return(_propertyGetter);
            }
            public override void Context()
            {
                _context       = mock <ISubstitutionContext>();
                _call          = mock <ICall>();
                _state         = mock <ISubstituteState>();
                _receivedCalls = mock <IReceivedCalls>();
                ConfigureCall  = mock <IConfigureCall>();
                _routeFactory  = mock <IRouteFactory>();
                _state.stub(x => x.ReceivedCalls).Return(_receivedCalls);
                _state.stub(x => x.ConfigureCall).Return(ConfigureCall);

                var recordReplayRoute = CreateRouteThatReturns(_returnValueFromRecordReplayRoute);

                recordReplayRoute.stub(x => x.IsRecordReplayRoute).Return(true);
                _routeFactory.stub(x => x.RecordReplay(_state)).Return(recordReplayRoute);
            }
 public ReturnAutoValueForThisAndSubsequentCallsHandler(IEnumerable <IAutoValueProvider> autoValueProviders, IConfigureCall configureCall)
 {
     _autoValueProviders = autoValueProviders;
     ConfigureCall       = configureCall;
 }
 public ReturnAutoValueForThisAndSubsequentCallsHandler(IEnumerable<IAutoValueProvider> autoValueProviders, IConfigureCall configureCall)
 {
     _autoValueProviders = autoValueProviders;
     ConfigureCall = configureCall;
 }
 public ReturnFromAndConfigureDynamicCall(IConfigureCall configureCall)
 {
     _configureCall = configureCall;
 }
示例#9
0
 public ReturnAutoValue(AutoValueBehaviour autoValueBehaviour, IEnumerable <IAutoValueProvider> autoValueProviders, IConfigureCall configureCall)
 {
     _autoValueProviders = autoValueProviders;
     ConfigureCall       = configureCall;
     _autoValueBehaviour = autoValueBehaviour;
 }
示例#10
0
 public PropertySetterHandler(IPropertyHelper propertyHelper, IConfigureCall configureCall)
 {
     _propertyHelper = propertyHelper;
     ConfigureCall   = configureCall;
 }
 public PropertySetterHandler(IPropertyHelper propertyHelper, IConfigureCall configureCall)
 {
     _propertyHelper = propertyHelper;
     ConfigureCall = configureCall;
 }