Exemple #1
0
    public IEnumerator Test_DoorControlInformsDyingEnemyWetherTheyAreTheLast()
    {
        GameObject     enemies = CreateEnemiesToWaitFor(2);
        DoorControl    door    = CreateDoorControl(enemies, new Vector3(1, 1, 1));
        Player         player  = CreatePlayer();
        GameController gameCtr = CreateGameController(player);

        yield return(new WaitForEndOfFrame());

        Enemy firstEnemy  = door.GetEnemies()[0];
        Enemy secondEnemy = door.GetEnemies()[1];

        gameCtr.StartBattle(firstEnemy);
        firstEnemy.stats.ReceiveDamage(firstEnemy.stats.GetMaxHealth());

        Assert.IsFalse(door.CheckIfLastEnemy(), "Door Control told the wrong enemy that they are the last!");

        yield return(new WaitForEndOfFrame());

        gameCtr.StartBattle(secondEnemy);
        secondEnemy.stats.ReceiveDamage(secondEnemy.stats.GetMaxHealth());

        Assert.IsTrue(door.CheckIfLastEnemy(), "Door Control did not tell the right enemy that they are the last!");
    }