public void ReturnsForOneMove() { StringMoveParser parser = new StringMoveParser(); List<IMove> moves = parser.GetMoves("M"); Assert.IsInstanceOfType(moves.First(), typeof(Move)); Assert.AreEqual(1, moves.Count); }
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)); }
public void TestEmptyMoves() { IMoveParser parser = new StringMoveParser(); IMoveSupplier supplier = new StandardMoveSupplier(parser); supplier.Init(""); Assert.IsFalse(supplier.HasNextMove()); }
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()); }
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()); }
public void ReturnsTwoMovesForTwoRight() { StringMoveParser parser = new StringMoveParser(); List<IMove> moves = parser.GetMoves("RR"); Assert.AreEqual(2, moves.Count); }
public void ReturnsMovesForOneLeft() { StringMoveParser parser = new StringMoveParser(); List<IMove> moves = parser.GetMoves("L"); Assert.AreEqual(1, moves.Count); }
public void ReturnsForOneRight() { StringMoveParser parser = new StringMoveParser(); List<IMove> moves = parser.GetMoves("R"); Assert.IsInstanceOfType(moves.First(), typeof(RightTurn)); }