Ejemplo n.º 1
0
        public void Test_CanMoveLeft_WhenAtTheLeftEdge_ReturnsFalse()
        {
            Field subject = new Field(10, 10);
            subject.SetBlock(new BlockHelper.MockBlock(2, 1), new Vector2(0, 5));

            Assert.That(subject.CanMoveLeft(), Is.False);
        }
Ejemplo n.º 2
0
        public void Test_CanMoveLeft_WhenNotAtTheLeftEdge_ReturnsTrue()
        {
            Field subject = new Field(10, 10);
            subject.SetBlock(UNUSED_BLOCK, new Vector2(1, 5));

            Assert.IsTrue(subject.CanMoveLeft());
        }
Ejemplo n.º 3
0
        public void TwoColumnMoveLeftOkTest()
        {
            Field field = new Field( 2, 10 );
            IBlock block = new Block();
            field.SetBlock( block, new Point( 1, 0 ) );
            block.Grid [ 0 ] [ 0 ] = Color.Tomato;

            bool moveleft = field.CanMoveLeft();
            Assert.AreEqual( true, moveleft );
        }
Ejemplo n.º 4
0
        public void SingleColumnNoMovesTest()
        {
            Field field = new Field( 1, 10 );
            IBlock block = new Block();
            block.Grid [ 0 ] [ 0 ] = Color.Tomato;

            field.SetBlock( block, new Point( 0, 0 ) );

            block.Grid [ 0 ] [ 0 ] = Color.Tomato;

            bool moveleft = field.CanMoveLeft();
            Assert.AreEqual( false, moveleft );
            bool moveright = field.CanMoveRight();
            Assert.AreEqual( false, moveright );
        }