예제 #1
0
 public void TestEmptyMoves()
 {
     IMoveParser parser = new StringMoveParser();
     IMoveSupplier supplier = new StandardMoveSupplier(parser);
     supplier.Init("");
     Assert.IsFalse(supplier.HasNextMove());
 }
예제 #2
0
 public void TestOneMove()
 {
     IMoveParser parser = new StringMoveParser();
     IMoveSupplier supplier = new StandardMoveSupplier(parser);
     supplier.Init("L");
     Assert.IsTrue(supplier.HasNextMove());
     supplier.NextMove();
     Assert.IsFalse(supplier.HasNextMove());
 }
예제 #3
0
 public void TestTwoMovesAreInCorrectOrder()
 {
     IMoveParser parser = new StringMoveParser();
     IMoveSupplier supplier = new StandardMoveSupplier(parser);
     supplier.Init("LR");
     Assert.IsTrue(supplier.HasNextMove());
     Assert.IsInstanceOfType(supplier.NextMove(), typeof(LeftTurn));
     Assert.IsInstanceOfType(supplier.NextMove(), typeof(RightTurn));
     Assert.IsFalse(supplier.HasNextMove());
 }