Пример #1
0
        public void insert_before_on_a_node()
        {
            var chain   = new BehaviorChain();
            var wrapper = new Wrapper(typeof(ObjectDefInstanceTester.FakeJsonBehavior));

            chain.AddToEnd(wrapper);

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

            wrapper.AddBefore(wrapper2);

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

            wrapper2.Previous.ShouldBeNull();
            wrapper.Previous.ShouldBeTheSameAs(wrapper2);
        }
Пример #2
0
        public void insert_before_on_a_node()
        {
            var chain = new BehaviorChain();
            var wrapper = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));

            chain.AddToEnd(wrapper);

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

            wrapper.AddBefore(wrapper2);

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

            wrapper2.Previous.ShouldBeNull();
            wrapper.Previous.ShouldBeTheSameAs(wrapper2);
        }