当前位置: 首页>>代码示例>>C#>>正文


C# BehaviorChain.Append方法代码示例

本文整理汇总了C#中BehaviorChain.Append方法的典型用法代码示例。如果您正苦于以下问题:C# BehaviorChain.Append方法的具体用法?C# BehaviorChain.Append怎么用?C# BehaviorChain.Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BehaviorChain的用法示例。


在下文中一共展示了BehaviorChain.Append方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: calls_finds_all_calls_underneath_the_chain

        public void calls_finds_all_calls_underneath_the_chain()
        {
            var chain = new BehaviorChain();
            ActionCall call = ActionCall.For<TestController>(x => x.AnotherAction(null));
            ActionCall call2 = ActionCall.For<TestController>(x => x.AnotherAction(null));
            chain.Append(call);
            chain.Append(call2);

            chain.Calls.Count().ShouldEqual(2);
            chain.Calls.Contains(call).ShouldBeTrue();
            chain.Calls.Contains(call2).ShouldBeTrue();
        }
开发者ID:bbehrens,项目名称:fubumvc,代码行数:12,代码来源:BehaviorChainTester.cs

示例2: write_with_multiple_outputs

        public void write_with_multiple_outputs()
        {
            var chain = new BehaviorChain();
            var json = new RenderJsonNode(typeof (RouteInput));
            chain.Append(json);

            var text = new RenderTextNode<RouteInput>();
            chain.Append(text);

            var tag = new HtmlTag("td");

            var column = new OutputColumn();
            column.WriteBody(chain, tag);

            tag.Text().ShouldEqual(json.Description + ", " + text.Description);
        }
开发者ID:bbehrens,项目名称:fubumvc,代码行数:16,代码来源:OutputColumnTester.cs

示例3: 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.Append(call1);

            ActionCall call2 = ActionCall.For<TargetController>(x => x.GoWithInput(null));
            chain.Append(call2);

            var column = new ActionColumn();

            var tag = new HtmlTag("td");

            column.WriteBody(chain, tag);

            tag.Text().ShouldEqual(call1.Description + ", " + call2.Description);
        }
开发者ID:bbehrens,项目名称:fubumvc,代码行数:17,代码来源:ActionColumnTester.cs

示例4: append_with_no_behaviors

        public void append_with_no_behaviors()
        {
            var chain = new BehaviorChain();
            var wrapper = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));

            chain.Append(wrapper);

            chain.Top.ShouldBeTheSameAs(wrapper);
        }
开发者ID:bbehrens,项目名称:fubumvc,代码行数:9,代码来源:BehaviorChainTester.cs

示例5: write_body_for_chain_with_input_type

        public void write_body_for_chain_with_input_type()
        {
            var chain = new BehaviorChain();
            chain.Append(ActionCall.For<ControllerTarget>(x => x.OneInOneOut(null)));
            var tag = new HtmlTag("td");

            new InputModelColumn().WriteBody(chain, tag);

            tag.Text().ShouldEqual(typeof (Model1).Name);
            tag.Title().ShouldEqual(typeof (Model1).AssemblyQualifiedName);
        }
开发者ID:bbehrens,项目名称:fubumvc,代码行数:11,代码来源:InputModelColumnTester.cs

示例6: prepend_with_an_existing_top_behavior

        public void prepend_with_an_existing_top_behavior()
        {
            var chain = new BehaviorChain();
            ActionCall call = ActionCall.For<TestController>(x => x.AnotherAction(null));
            chain.Append(call);

            var wrapper = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));
            chain.Prepend(wrapper);

            chain.Top.ShouldBeTheSameAs(wrapper);
            wrapper.Next.ShouldBeTheSameAs(call);
        }
开发者ID:bbehrens,项目名称:fubumvc,代码行数:12,代码来源:BehaviorChainTester.cs

示例7: has_input

        public void has_input()
        {
            var chain = new BehaviorChain();
            chain.HasInput().ShouldBeFalse();

            chain.Append(ActionCall.For<ControllerTarget>(x => x.ZeroInOneOut()));
            chain.HasInput().ShouldBeFalse();

            chain = new BehaviorChain();
            chain.Append(ActionCall.For<ControllerTarget>(x => x.OneInOneOut(null)));
            chain.HasInput().ShouldBeTrue();
        }
开发者ID:bbehrens,项目名称:fubumvc,代码行数:12,代码来源:BehaviorChainTester.cs

示例8: write_with_a_single_output

        public void write_with_a_single_output()
        {
            var chain = new BehaviorChain();
            var node = new RenderJsonNode(typeof (RouteInput));
            chain.Append(node);

            var tag = new HtmlTag("td");

            var column = new OutputColumn();
            column.WriteBody(chain, tag);

            tag.Text().ShouldEqual(node.Description);
        }
开发者ID:bbehrens,项目名称:fubumvc,代码行数:13,代码来源:OutputColumnTester.cs

示例9: write_body_cell_with_only_one_call

        public void write_body_cell_with_only_one_call()
        {
            var chain = new BehaviorChain();
            ActionCall call = ActionCall.For<TargetController>(x => x.Go());
            chain.Append(call);

            var column = new ActionColumn();

            var tag = new HtmlTag("td");

            column.WriteBody(chain, tag);

            tag.Text().ShouldEqual(call.Description);
        }
开发者ID:bbehrens,项目名称:fubumvc,代码行数:14,代码来源:ActionColumnTester.cs

示例10: insert_before_on_a_node

        public void insert_before_on_a_node()
        {
            var chain = new BehaviorChain();
            var wrapper = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));

            chain.Append(wrapper);

            var wrapper2 = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));

            wrapper.InsertDirectlyBefore(wrapper2);

            chain.Top.ShouldBeTheSameAs(wrapper2);
            wrapper2.Next.ShouldBeTheSameAs(wrapper);

            wrapper2.Previous.ShouldBeTheSameAs(chain);
            wrapper.Previous.ShouldBeTheSameAs(wrapper2);
        }
开发者ID:bbehrens,项目名称:fubumvc,代码行数:17,代码来源:BehaviorChainTester.cs

示例11: setting_next_on_a_node_also_sets_the_previous

        public void setting_next_on_a_node_also_sets_the_previous()
        {
            var chain = new BehaviorChain();
            var wrapper = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));

            chain.Append(wrapper);

            wrapper.Previous.ShouldBeTheSameAs(chain);

            var wrapper2 = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));

            wrapper.Append(wrapper2);

            wrapper2.Previous.ShouldBeTheSameAs(wrapper);
            wrapper.Previous.ShouldBeTheSameAs(chain);
        }
开发者ID:bbehrens,项目名称:fubumvc,代码行数:16,代码来源:BehaviorChainTester.cs

示例12: the_unique_id_of_the_behavior_chain_matches_the_object_def_name

        public void the_unique_id_of_the_behavior_chain_matches_the_object_def_name()
        {
            var chain = new BehaviorChain();
            ActionCall call = ActionCall.For<TestController>(x => x.AnotherAction(null));
            chain.Append(call);

            chain.UniqueId.ToString().ShouldEqual(chain.ToObjectDef().Name);
        }
开发者ID:bbehrens,项目名称:fubumvc,代码行数:8,代码来源:BehaviorChainTester.cs

示例13: registerBehavior

 private void registerBehavior(ActionCall call)
 {
     var chain = new BehaviorChain();
     chain.Append(call);
     _graph.AddChain(chain);
 }
开发者ID:bbehrens,项目名称:fubumvc,代码行数:6,代码来源:BehaviorMatcher.cs


注:本文中的BehaviorChain.Append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。