Esempio n. 1
0
        public void get_enum_should_yield_top()
        {
            var firstNode  = new BehaviorChain();
            var secondNode = new BehaviorChain();
            var thirdNode  = new BehaviorChain();

            firstNode.AddToEnd(secondNode);
            secondNode.AddToEnd(thirdNode);
            var enumerator = firstNode.GetEnumerator();

            enumerator.MoveNext();
            enumerator.Current.ShouldEqual(secondNode);
            enumerator.MoveNext();
            enumerator.Current.ShouldEqual(thirdNode);
            enumerator.MoveNext().ShouldBeFalse();
        }
 public void get_enum_should_yield_top()
 {
     var firstNode = new BehaviorChain();
     var secondNode = new BehaviorChain();
     var thirdNode = new BehaviorChain();
     firstNode.AddToEnd(secondNode);
     secondNode.AddToEnd(thirdNode);
     var enumerator = firstNode.GetEnumerator();
     enumerator.MoveNext();
     enumerator.Current.ShouldEqual(secondNode);
     enumerator.MoveNext();
     enumerator.Current.ShouldEqual(thirdNode);
     enumerator.MoveNext().ShouldBeFalse();
 }