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>(); }; }); }
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(); }
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); }
public IActionBehavior BuildBehavior(BehaviorChain chain) { var behavior = _factory.BuildBehavior(_arguments, chain.UniqueId); return(new FullChainSwitcher(behavior, _currentChain, chain)); }
public IActionBehavior BuildPartial(Type inputType) { Guid id = _graph.IdForType(inputType); return(_factory.BuildBehavior(_arguments, id)); }