コード例 #1
0
        public void is_in_partial_negative_after_popping_the_last_child()
        {
            var currentChain = new CurrentChain(theChain, null);

            currentChain.Push(theSecondChain);
            currentChain.Push(theThirdChain);

            currentChain.Pop();
            currentChain.Pop();

            currentChain.IsInPartial().ShouldBeFalse();
        }
コード例 #2
0
        public void is_in_partial_positive()
        {
            var currentChain = new CurrentChain(theChain, null);

            currentChain.Push(theSecondChain);
            currentChain.IsInPartial().ShouldBeTrue();

            currentChain.Push(theThirdChain);
            currentChain.IsInPartial().ShouldBeTrue();

            currentChain.Pop();
            currentChain.IsInPartial().ShouldBeTrue();
        }
コード例 #3
0
        public void push_and_pop_track_the_current_chain()
        {
            var currentChain = new CurrentChain(theChain, theRouteData);

            currentChain.Push(theSecondChain);

            currentChain.Current.ShouldBeTheSameAs(theSecondChain);

            currentChain.Push(theThirdChain);
            currentChain.Current.ShouldBeTheSameAs(theThirdChain);

            currentChain.Pop();
            currentChain.Current.ShouldBeTheSameAs(theSecondChain);

            currentChain.Pop();
            currentChain.Current.ShouldBeTheSameAs(theChain);
        }
コード例 #4
0
        public void the_top_chain_is_always_the_originating_chain()
        {
            var currentChain = new CurrentChain(theChain, theRouteData);

            currentChain.OriginatingChain.ShouldBeTheSameAs(theChain);

            currentChain.Push(theSecondChain);
            currentChain.OriginatingChain.ShouldBeTheSameAs(theChain);

            currentChain.Pop();

            currentChain.OriginatingChain.ShouldBeTheSameAs(theChain);
        }