Esempio n. 1
0
        public void IsNotEmptyAfterNodeEmbarked()
        {
            var ft = new FifoTraversal();

            ft.Embark(CreateNode());
            Assert.IsFalse(ft.IsEmpty);
        }
Esempio n. 2
0
        public void DisembarkWhenEmptyThrows()
        {
            var ft = new FifoTraversal();

            ft.Embark(CreateNode());
            ft.Disembark();
            ft.Disembark();
        }
Esempio n. 3
0
        public void IsEmptyAfterNodeEmbarkedAndDisembarked()
        {
            var ft = new FifoTraversal();

            ft.Embark(CreateNode());
            ft.Disembark();
            Assert.IsTrue(ft.IsEmpty);
        }
Esempio n. 4
0
        public void CanStillBeUsedAfterEmptied()
        {
            // ability to reuse is incidental; capturing in unit test just so
            // we know if behavior ever changes
            var ft = new FifoTraversal();

            ft.Embark(CreateNode());
            ft.Disembark();
            ft.Embark(CreateNode());
            Assert.IsFalse(ft.IsEmpty);
        }
Esempio n. 5
0
        public void DuplicateNodesAllowed()
        {
            // duplicate nodes may not be a good idea, but is allowed, at least incidentally
            var ft   = new FifoTraversal();
            var node = CreateNode();

            ft.Embark(node);
            ft.Embark(node);
            ft.Disembark();
            ft.Disembark();
            Assert.IsTrue(ft.IsEmpty);
        }