示例#1
0
        public void L_Should_South()
        {
            var lShape = new LShapedPiece();

            lShape.Turn();
            lShape.Turn();
            var exptected = PieceOrientation.South;
            var actual    = lShape.Orientation;

            Assert.AreEqual(exptected, actual);
        }
示例#2
0
        public void L_Should_TurnRight()
        {
            var lShape           = new LShapedPiece();
            var collisionMapList = lShape.DecomposeCollisionMapInLinesOfBlocks();

            lShape.Turn();
            var turnedCollisionMapList = lShape.DecomposeCollisionMapInLinesOfBlocks();
            var first       = collisionMapList.First().Last();
            var firstTurned = turnedCollisionMapList.Last().Last();

            Assert.AreEqual(first, firstTurned);
            var second       = collisionMapList[1].Last();
            var secondTurned = turnedCollisionMapList[1][1];

            Assert.AreEqual(second, secondTurned);
        }
示例#3
0
        public void L_Should_DoubleTurn()
        {
            var lShape           = new LShapedPiece();
            var collisionMapList = lShape.DecomposeCollisionMapInLinesOfBlocks();

            lShape.Turn();
            lShape.Turn();
            var turnedCollisionMapList = lShape.DecomposeCollisionMapInLinesOfBlocks();
            var expected = collisionMapList[0][1];
            var actual   = turnedCollisionMapList[1][0];

            Assert.AreEqual(expected, actual);
            var expected1 = collisionMapList[1][1];
            var actual1   = turnedCollisionMapList[2][0];

            Assert.AreEqual(expected1, actual1);
        }
示例#4
0
        public void LShaped_Should_Be_Four_Contiguous_Blocks()
        {
            var lShapedPiece = new LShapedPiece();

            Assert.IsTrue(lShapedPiece.IsFourContiguousBlocks);
        }