本文整理汇总了C#中BehaviorGraph.ChainFor方法的典型用法代码示例。如果您正苦于以下问题:C# BehaviorGraph.ChainFor方法的具体用法?C# BehaviorGraph.ChainFor怎么用?C# BehaviorGraph.ChainFor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BehaviorGraph
的用法示例。
在下文中一共展示了BehaviorGraph.ChainFor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
public void SetUp()
{
_runtime = FubuRuntime.For<ApplicationRegistry>();
behaviors = _runtime.Get<BehaviorGraph>();
appChain = behaviors.ChainFor<ApplicationActions>(x => x.get_app_action());
pakChain = behaviors.ChainFor<PackageActions>(x => x.get_pak_action());
}
示例2: SetUp
public void SetUp()
{
theHttpRequest = OwinHttpRequest.ForTesting();
UrlContext.Stub("http://server");
theUrlResolver = new ChainUrlResolver(theHttpRequest);
theGraph = BehaviorGraph.BuildFrom(registry =>
{
registry.Actions.IncludeType<ChainUrlResolverEndpoint>();
});
theSimpleChain = theGraph.ChainFor<ChainUrlResolverEndpoint>(x => x.get_index());
theChainWithRouteParams = theGraph.ChainFor(typeof(ChainUrlParams));
}
示例3: SetUp
public void SetUp()
{
var registry = new FubuRegistry(x => {
x.Actions.IncludeClassesSuffixedWithController();
x.Configure(g =>
{
g.ChainFor<AuthorizedController>(c => c.Go(null)).Authorization.AddRole("RoleA");
});
});
graph = BehaviorGraph.BuildFrom(registry);
goChain = graph.ChainFor<AuthorizedController>(x => x.Go(null));
moveChain = graph.ChainFor<AuthorizedController>(x => x.Move(null));
}
示例4: should_throw_an_exception_if_the_result_is_not_unique
public void should_throw_an_exception_if_the_result_is_not_unique()
{
var call1 = ActionCall.For<Issue101Endpoint>(x => x.get_hello());
var call2 = ActionCall.For<Issue101Endpoint>(x => x.get_hello());
var graph = new BehaviorGraph();
graph.AddChain().AddToEnd(call1);
graph.AddChain().AddToEnd(call2);
Exception<FubuException>.ShouldBeThrownBy(() => {
graph.ChainFor<Issue101Endpoint>(x => x.get_hello());
});
}
示例5: SetUp
public void SetUp()
{
container = new Container();
container.Inject(new TransportSettings
{
DelayMessagePolling = Int32.MaxValue,
ListenerCleanupPolling = Int32.MaxValue
});
theServiceBus = MockRepository.GenerateMock<IServiceBus>();
var registry = new FubuRegistry();
registry.ServiceBus.Enable(true);
registry.Actions.IncludeType<MessageOnePublisher>();
registry.StructureMap(container);
registry.AlterSettings<LightningQueueSettings>(x => x.DisableIfNoChannels = true);
theRuntime = registry.ToRuntime();
theGraph = theRuntime.Get<BehaviorGraph>();
chain = theGraph.ChainFor<MessageOnePublisher>(x => x.post_message1(null));
container.Inject(theServiceBus);
}