示例#1
0
        public void TestEnemyOnRightOfBlockCollisionHandling()
        {
            IEnemy     enemy       = new Goomba(new Vector2(110, 100));
            Goomba     staticEnemy = new Goomba(new Vector2(100, 100));
            FloorBlock block       = new FloorBlock(new Vector2(100, 100));

            Rectangle enemyRect = enemy.GetRectangle();
            Rectangle blockRect = block.GetRectangle();

            Game1.Side collisionType = Game1.Side.Left;
            EnemyBlockCollisionHandler.HandleCollision(enemy, block, collisionType);

            IEnemyState enemyState    = enemy.GetState();
            IEnemyState expectedState = new GoombaLeftMovingState(staticEnemy);

            Assert.AreEqual(enemyState.ToString(), expectedState.ToString());
        }