public void MoveNext_NoNextMove_ReturnsFalse() { var game = new Game(); var enumerator = new GameToPgnEnumerator(game.InitialNode.Node); var actual = enumerator.MoveNext(); Assert.IsFalse(actual, "Node should return false when current move is last."); }
public void MoveNext_NoCurrentMoveThrowsException() { var game = new Game(); var enumerator = new GameToPgnEnumerator(game); Assert.Throws <InvalidOperationException>(() => { var unused = enumerator.Current; }); }
/// <summary> /// Writes move section in PGN form. /// </summary> /// <param name="node">The starting node.</param> /// <param name="pgnWriter">The writer used to write the information.</param> public void Serialize(MoveTreeNode <PostMoveState> node, PgnWriter pgnWriter) { var enumerator = new GameToPgnEnumerator(node); while (enumerator.MoveNext()) { var move = enumerator.Current; pgnWriter.WriteMove(move); } }