public void BannedRainbow_Used() { var sut = new BannedPieceType("r"); var sequence = new LinkedList <ISquarePiece>(); sequence.AddLast(CreatePiece(PieceTypes.Normal)); sequence.AddLast(CreatePiece(PieceTypes.Rainbow)); sequence.AddLast(CreatePiece(PieceTypes.Normal)); sut.SequenceCompleted(sequence.ToArray()); Assert.IsTrue(sut.ViolatedRestriction()); }
public void BannedSwapping_NotUsed() { var sut = new BannedPieceType("s"); var sequence = new LinkedList <ISquarePiece>(); sequence.AddLast(CreatePiece(PieceTypes.Rainbow)); sequence.AddLast(CreatePiece(PieceTypes.ThreePoints)); sequence.AddLast(CreatePiece(PieceTypes.FourPoints)); sut.SequenceCompleted(sequence.ToArray()); Assert.IsFalse(sut.ViolatedRestriction()); }
public void PieceTypeRestriction_Best5() { IRestriction restriction = new BannedPieceType("r"); var pieces = new string[] { "1--1", "r1--", "-1-1", "--1-" }; BuildGrid(pieces); var move = BestMoverChecker.GetBestMove(restriction).Move; Assert.AreEqual(5, move.Count); Assert.IsFalse(restriction.IsRestrictionViolated(move.ToArray())); }