Example #1
0
 public void each_IActionBehavior_is_wrapped_with_a_nested_container_behavior()
 {
     graph.VisitRoutes(x =>
     {
         x.Actions += (r, chain) =>
         {
             factory.BuildBehavior(new ServiceArguments(), chain.UniqueId).ShouldBeOfType
             <NestedStructureMapContainerBehavior>();
         };
     });
 }
Example #2
0
        public void Invoke(ServiceArguments arguments, IDictionary <string, object> routeValues)
        {
            var currentChain = new CurrentChain(_chain, routeValues);

            arguments.Set(typeof(ICurrentChain), currentChain);

            if (_chain.Filters.Any(filter => filter.Filter(arguments) == DoNext.Stop))
            {
                return;
            }

            var behavior = _factory.BuildBehavior(arguments, _chain.UniqueId);

            behavior.Invoke();
        }
Example #3
0
        public IActionBehavior BuildBehavior(ServiceArguments arguments, Guid behaviorId)
        {
            var diagnostics = _container.Get <DiagnosticBehavior>();

            var writer = _container.Get <IOutputWriter>();
            var report = _container.Get <IDebugReport>();

            arguments.Set(typeof(IOutputWriter), new RecordingOutputWriter(report, writer));

            var behavior = _inner.BuildBehavior(arguments, behaviorId);

            diagnostics.Inner = behavior;

            return(diagnostics);
        }
Example #4
0
        public IActionBehavior BuildBehavior(BehaviorChain chain)
        {
            var behavior = _factory.BuildBehavior(_arguments, chain.UniqueId);

            return(new FullChainSwitcher(behavior, _currentChain, chain));
        }
Example #5
0
        public IActionBehavior BuildPartial(Type inputType)
        {
            Guid id = _graph.IdForType(inputType);

            return(_factory.BuildBehavior(_arguments, id));
        }