public void when_there_is_only_one_chain_for_that_input_model() { var graph = new BehaviorGraph(null); var chain = BehaviorChain.For <ControllerTarget>(x => x.OneInOneOut(null)); graph.AddChain(chain); graph.IdForType(typeof(Model1)).ShouldEqual(chain.UniqueId); }
public void should_throw_2151_if_the_input_type_has_multiple_possible_behavior_chains() { var graph = new BehaviorGraph(null); graph.AddChain(BehaviorChain.For <ControllerTarget>(x => x.OneInOneOut(null))); graph.AddChain(BehaviorChain.For <ControllerTarget>(x => x.OneInZeroOut(null))); Exception <FubuException> .ShouldBeThrownBy(() => { graph.IdForType(typeof(Model1)); }).ErrorCode.ShouldEqual (2151); }
public void should_throw_2151_if_the_input_type_has_multiple_possible_behavior_chains() { var graph = new BehaviorGraph(null); graph.AddChain(BehaviorChain.For<ControllerTarget>(x => x.OneInOneOut(null))); graph.AddChain(BehaviorChain.For<ControllerTarget>(x => x.OneInZeroOut(null))); Exception<FubuException>.ShouldBeThrownBy(() => { graph.IdForType(typeof (Model1)); }).ErrorCode.ShouldEqual (2151); }
public void when_there_is_only_one_chain_for_that_input_model() { var graph = new BehaviorGraph(null); BehaviorChain chain = BehaviorChain.For<ControllerTarget>(x => x.OneInOneOut(null)); graph.AddChain(chain); graph.IdForType(typeof (Model1)).ShouldEqual(chain.UniqueId); }
public IActionBehavior BuildPartial(Type inputType) { Guid id = _graph.IdForType(inputType); return(_factory.BuildBehavior(_arguments, id)); }