Example #1
0
        public void TurnFourTime()
        {
            var shape = new TetriminoL();

            Call.Action(4, () => shape.Turn());
            Check.That(shape).IsEquivalentTo((2, 1), (1, 1), (1, 2), (1, 3));
        }
Example #2
0
        public void TurnTwoTime()
        {
            var shape = new TetriminoL();

            Call.Action(2, () => shape.Turn());
            Check.That(shape).IsEquivalentTo((1, 3), (2, 3), (2, 2), (2, 1));
        }
Example #3
0
        public void TurnThreeTime()
        {
            var shape = new TetriminoL();

            Call.Action(3, () => shape.Turn());
            Check.That(shape).IsEquivalentTo((3, 2), (3, 1), (2, 1), (1, 1));
        }
Example #4
0
        public void TurnOneTime(int start, FakeShape expected)
        {
            var shape = new TetriminoL(start);

            shape.Turn();
            Check.That(shape).IsEquivalentTo(expected);
        }
Example #5
0
        public void MoveLeft(int actionCount, int col1, int col2, int col3, int col4)
        {
            var shape = new TetriminoL(7);

            Call.Action(actionCount, () => shape.MoveLeft());
            Check.That(shape).IsEquivalentTo((2, col1), (1, col2), (1, col3), (1, col4));
        }
Example #6
0
        public void TurnCorrectlyWhenReachedRightSideInVerticalLeftPosition()
        {
            var shape = new TetriminoL(9);

            shape.Turn();
            Call.Action(5, () => shape.MoveRight());
            shape.Turn();
            Check.That(shape).IsEquivalentTo((1, 12), (2, 12), (2, 11), (2, 10));
        }
Example #7
0
        public void TurnCorrectlyWhenReachedLeftSideInVerticalRightPosition()
        {
            var shape = new TetriminoL();

            shape.Turn();
            Call.Action(2, () => shape.MoveLeft());
            shape.Turn();
            Check.That(shape).IsEquivalentTo((1, 3), (2, 3), (2, 2), (2, 1));
        }
        public void SignalCollisionIfTouchingOtherBlock(int padding, bool expected)
        {
            var bottomStack = new BottomStack();
            var shape1      = new TetriminoJ();
            var shape2      = new TetriminoL();

            shape1.Turn();


            Call.Action(Game.Height, shape1.MoveDown);
            bottomStack.Add(shape1);

            Call.Action(Game.Height - padding, shape2.MoveDown);
            bottomStack.WillCollideBottom(shape2).Should().Be(expected);
        }
Example #9
0
        public void BeInitialized()
        {
            var shape = new TetriminoL();

            Check.That(shape).IsEquivalentTo((2, 1), (1, 1), (1, 2), (1, 3));
        }