コード例 #1
0
 public void ReturnsTurnsInRightOrder()
 {
     StringMoveParser parser = new StringMoveParser();
     List<IMove> moves = parser.GetMoves("LR");
     Assert.IsInstanceOfType(moves.First(), typeof(LeftTurn));
     Assert.IsInstanceOfType(moves.Skip(1).First(), typeof(RightTurn));
 }
コード例 #2
0
 public void ReturnsForOneMove()
 {
     StringMoveParser parser = new StringMoveParser();
     List<IMove> moves = parser.GetMoves("M");
     Assert.IsInstanceOfType(moves.First(), typeof(Move));
     Assert.AreEqual(1, moves.Count);
 }
コード例 #3
0
 public void ReturnsTwoMovesForTwoRight()
 {
     StringMoveParser parser = new StringMoveParser();
     List<IMove> moves = parser.GetMoves("RR");
     Assert.AreEqual(2, moves.Count);
 }
コード例 #4
0
 public void ReturnsMovesForOneLeft()
 {
     StringMoveParser parser = new StringMoveParser();
     List<IMove> moves = parser.GetMoves("L");
     Assert.AreEqual(1, moves.Count);
 }
コード例 #5
0
 public void ReturnsForOneRight()
 {
     StringMoveParser parser = new StringMoveParser();
     List<IMove> moves = parser.GetMoves("R");
     Assert.IsInstanceOfType(moves.First(), typeof(RightTurn));
 }