public void IsNotEmptyAfterNodeEmbarked() { var ft = new FifoTraversal(); ft.Embark(CreateNode()); Assert.IsFalse(ft.IsEmpty); }
public void DisembarkWhenEmptyThrows() { var ft = new FifoTraversal(); ft.Embark(CreateNode()); ft.Disembark(); ft.Disembark(); }
public void IsEmptyAfterNodeEmbarkedAndDisembarked() { var ft = new FifoTraversal(); ft.Embark(CreateNode()); ft.Disembark(); Assert.IsTrue(ft.IsEmpty); }
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); }
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); }