コード例 #1
0
            public override void Context()
            {
                _substituteState = mock <ISubstituteState>();
                _callHandlers    = new[] { mock <ICallHandler>(), mock <ICallHandler>() };
                _routeArguments  = new[] { new object(), new object() };

                _callHandlerFactory = mock <ICallHandlerFactory>();
                _callHandlerFactory.stub(x => x.CreateCallHandler(SampleRouteDefinition.Handlers[0], _substituteState, _routeArguments)).Return(_callHandlers[0]);
                _callHandlerFactory.stub(x => x.CreateCallHandler(SampleRouteDefinition.Handlers[1], _substituteState, _routeArguments)).Return(_callHandlers[1]);

                temporarilyChange(() => RouteFactory.ConstructRoute).to(x => new FakeRoute(x));
            }
コード例 #2
0
ファイル: RouteFactory.cs プロジェクト: phiree/NSubstitute
 public RouteFactory(ISubstituteState substituteState, ICallHandlerFactory callHandlerFactory)
 {
     _substituteState    = substituteState;
     _callHandlerFactory = callHandlerFactory;
 }