本文整理汇总了C#中BehaviorChain.AddToEnd方法的典型用法代码示例。如果您正苦于以下问题:C# BehaviorChain.AddToEnd方法的具体用法?C# BehaviorChain.AddToEnd怎么用?C# BehaviorChain.AddToEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BehaviorChain
的用法示例。
在下文中一共展示了BehaviorChain.AddToEnd方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: do_nothing_if_tracing_is_off
public void do_nothing_if_tracing_is_off()
{
var registry = new FubuRegistry();
registry.AlterSettings<DiagnosticsSettings>(x => x.TraceLevel = TraceLevel.None);
registry.Configure(graph =>
{
chain1 = new BehaviorChain();
chain1.AddToEnd(Wrapper.For<SimpleBehavior>());
chain1.AddToEnd(Wrapper.For<DifferentBehavior>());
chain1.Route = new RouteDefinition("something");
graph.AddChain(chain1);
chain2 = new BehaviorChain();
chain2.IsPartialOnly = true;
chain2.AddToEnd(Wrapper.For<SimpleBehavior>());
chain2.AddToEnd(Wrapper.For<DifferentBehavior>());
graph.AddChain(chain2);
});
registry.Policies.Add<ApplyTracing>();
var notTracedGraph = BehaviorGraph.BuildFrom(registry);
notTracedGraph.Behaviors.SelectMany(x => x).Any(x => x is DiagnosticBehavior).ShouldBeFalse();
notTracedGraph.Behaviors.SelectMany(x => x).Any(x => x is BehaviorTracer).ShouldBeFalse();
}
示例2: but_does_match_the_last_call
public void but_does_match_the_last_call()
{
var chain = new BehaviorChain();
chain.AddToEnd(ActionCall.For<ActionEndpoint>(x => x.get_hello()));
chain.AddToEnd(ActionCall.For<ActionEndpoint>(x => x.SaySomethingHTML()));
var match = new LastActionMatch(call => call.Method.Name.EndsWith("HTML"));
match.Matches(chain).ShouldBeTrue();
}
示例3: calls_finds_all_calls_underneath_the_chain
public void calls_finds_all_calls_underneath_the_chain()
{
var chain = new BehaviorChain();
var call = ActionCall.For<TestController>(x => x.AnotherAction(null));
var call2 = ActionCall.For<TestController>(x => x.AnotherAction(null));
chain.AddToEnd(call);
chain.AddToEnd(call2);
chain.Calls.Count().ShouldEqual(2);
chain.Calls.Contains(call).ShouldBeTrue();
chain.Calls.Contains(call2).ShouldBeTrue();
}
示例4: modifies_a_chain
public void modifies_a_chain()
{
var chain = new BehaviorChain();
var theAction = ActionCall.For<AjaxController>(x => x.get_success());
chain.AddToEnd(theAction);
chain.AddToEnd(chain.Output.As<OutputNode>());
OutputBeforeAjaxContinuationPolicy.Modify(chain);
chain.First().ShouldBeTheSameAs(chain.Output);
chain.Last().ShouldBeTheSameAs(theAction);
}
示例5: Configure
public void Configure(BehaviorGraph graph)
{
if (!graph.Behaviors.Any(x => x.Route != null && x.GetRoutePattern().IsEmpty()))
{
var action = ActionCall.For<DefaultHome>(x => x.GoToDiagnostics());
var continuer = new ContinuationNode();
var chain = new BehaviorChain();
chain.Route = new RouteDefinition("");
chain.AddToEnd(action);
chain.AddToEnd(continuer);
graph.AddChain(chain);
}
}
示例6: write_with_multiple_outputs
public void write_with_multiple_outputs()
{
var chain = new BehaviorChain();
var json = new RenderJsonNode(typeof (RouteParameter));
chain.AddToEnd(json);
var text = new RenderTextNode<RouteParameter>();
chain.AddToEnd(text);
var tag = new HtmlTag("td");
var column = new OutputColumn();
column.WriteBody(chain, null, tag);
tag.Text().ShouldEqual(json.Description + ", " + text.Description);
}
示例7: appending_a_node_also_sets_the_previous_2
public void appending_a_node_also_sets_the_previous_2()
{
var chain = new BehaviorChain();
var wrapper = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));
chain.AddToEnd(wrapper);
wrapper.Previous.ShouldBeTheSameAs(chain);
var wrapper2 = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));
chain.AddToEnd(wrapper2);
wrapper2.Previous.ShouldBeTheSameAs(wrapper);
wrapper.Previous.ShouldBeTheSameAs(chain);
}
示例8: SetUp
public void SetUp()
{
theChain = new BehaviorChain();
var action = ActionCall.For<Controller1>(x => x.Go(null));
theChain.AddToEnd(action);
theOriginalGuid = action.UniqueId;
}
开发者ID:joemcbride,项目名称:fubumvc,代码行数:8,代码来源:BehaviorTracer_and_DiagnosticBehavior_construction_testing.cs
示例9: matches_positive_with_one_action
public void matches_positive_with_one_action()
{
var chain = new BehaviorChain();
chain.AddToEnd(ActionCall.For<ActionEndpoint>(x => x.SaySomethingHTML()));
var match = new LastActionMatch(call => call.Method.Name.EndsWith("HTML"));
match.Matches(chain).ShouldBeTrue();
}
示例10: matches_negative_with_one_action
public void matches_negative_with_one_action()
{
var chain = new BehaviorChain();
chain.AddToEnd(ActionCall.For<ActionEndpoint>(x => x.get_hello()));
var match = new LastActionMatch(call => call.Method.Name.EndsWith("HTML"));
match.Matches(chain).ShouldBeFalse();
}
示例11: automatically_excludes_the_NotAuthenticated_attribute
public void automatically_excludes_the_NotAuthenticated_attribute()
{
var chain = new BehaviorChain();
chain.AddToEnd(ActionCall.For<AuthenticatedEndpoints>(x => x.get_notauthenticated()));
new AuthenticationSettings().ShouldBeExcluded(chain)
.ShouldBeTrue();
}
示例12: write_body_cell_with_multiple_calls
public void write_body_cell_with_multiple_calls()
{
var chain = new BehaviorChain();
ActionCall call1 = ActionCall.For<TargetController>(x => x.Go());
chain.AddToEnd(call1);
ActionCall call2 = ActionCall.For<TargetController>(x => x.GoWithInput(null));
chain.AddToEnd(call2);
var column = new ActionColumn();
var tag = new HtmlTag("td");
column.WriteBody(chain, null, tag);
tag.Text().ShouldEqual(call1.Description + ", " + call2.Description);
}
示例13: SetUp
public void SetUp()
{
inner = Wrapper.For<SimpleBehavior>();
chain = new BehaviorChain();
chain.AddToEnd(inner);
theNode = new DiagnosticNode(chain);
}
示例14: Configure
public void Configure(BehaviorGraph graph)
{
var route = new RouteDefinition("");
route.AddHttpMethodConstraint("GET");
var chain = new BehaviorChain { Route = route };
chain.AddToEnd(new RedirectNode());
graph.AddChain(chain);
graph.Services.AddService(this);
}
示例15: adding_a_node_to_the_end_sets_the_chain_on_the_node
public void adding_a_node_to_the_end_sets_the_chain_on_the_node()
{
var chain = new BehaviorChain();
var wrapper = new Wrapper(typeof(ObjectDefInstanceTester.FakeJsonBehavior));
chain.AddToEnd(wrapper);
wrapper.ParentChain().ShouldBeTheSameAs(chain);
}