Ejemplo n.º 1
0
        public void append_when_next_is_null()
        {
            action = ActionCall.For<ControllerTarget>(x => x.OneInOneOut(null));
            var next = new RenderJsonNode(typeof (Model2));

            action.Append(next);

            action.Next.ShouldBeTheSameAs(next);
        }
Ejemplo n.º 2
0
 private void attachView(ViewBag bag, ActionCall call)
 {
     foreach (var strategy in _strategies)
     {
         var token = strategy.Find(call, bag);
         if (token == null) continue;
         call.Append(token.ToBehavioralNode());
         break;
     }
 }
Ejemplo n.º 3
0
        public void enrich_puts_the_new_chain_node_directly_behind_the_call()
        {
            action = ActionCall.For<ControllerTarget>(x => x.OneInOneOut(null));
            var next = new RenderJsonNode(typeof (Model2));

            action.Append(next);

            var enricher = new Wrapper(typeof (string));
            action.InsertDirectlyAfter(enricher);

            action.Next.ShouldBeTheSameAs(enricher);
            enricher.Next.ShouldBeTheSameAs(next);
        }
Ejemplo n.º 4
0
 private void attachView(ViewBag bag, ActionCall call)
 {
     foreach (IViewAttachmentStrategy strategy in _strategies)
     {
         IEnumerable<IViewToken> tokens = strategy.Find(call, bag);
         if (tokens.Count() == 1)
         {
             IViewToken token = tokens.First();
             call.Append(token.ToBehavioralNode());
             break;
         }
     }
 }
Ejemplo n.º 5
0
        public void append_to_descendent_when_next_is_not_null()
        {
            action = ActionCall.For<ControllerTarget>(x => x.OneInOneOut(null));
            var wrapper = new Wrapper(typeof (FakeBehavior));
            action.Next = wrapper;

            var next = new RenderJsonNode(typeof (Model2));

            action.Append(next);

            action.Next.ShouldBeTheSameAs(wrapper);
            wrapper.Next.ShouldBeTheSameAs(next);

            action.ShouldHaveTheSameElementsAs(wrapper, next);
        }