Пример #1
0
        public void Drop_EnoughSpace_BoardWithLine()
        {
            //arange
            IBoard board = new TestBoard(createBoardWithLineHor());
            IShape shape = new ShapeI(board);

            //act
            shape.Drop();
            int x = shape[0].Position.X;
            int y = shape[0].Position.Y;

            //assert
            Assert.AreEqual(4, x);             //expected, actual
            Assert.AreEqual(8, y);
        }
Пример #2
0
        public void Drop_NoSpace_EmptyBoard()
        {
            //arange
            IBoard board = new TestBoard(createEmptyBoard(10, 1));
            IShape shape = new ShapeI(board);

            //act
            shape.Drop();
            int x = shape[0].Position.X;
            int y = shape[0].Position.Y;

            //assert
            Assert.AreEqual(4, x);             //expected, actual
            Assert.AreEqual(0, y);
        }
Пример #3
0
        public void Move_OnJoinPile()
        {
            //arange
            IBoard board = new TestBoard(createEmptyBoard(10, 10));
            IShape shape = new ShapeI(board);

            bool eventJoin = false;

            shape.JoinPile += () => eventJoin = true;
            //act
            shape.Drop();

            //assert
            Assert.IsTrue(eventJoin);
        }