Beispiel #1
0
        public IEnumerator SpellCardDefeatedTest()
        {
            bool isSpellCardFinished = false, isSpellCardEnded = false;
            EventHandler <EventArgs> onSpellCardFinished = (o, s) => isSpellCardFinished = true;
            EventHandler <EventArgs> onSpellCardEnded    = (o, s) => isSpellCardEnded = true;

            SpellCard       testSpellCard                = DataInjectorTestHelerMethod.GetTestSpellCard(1).GetComponent <SpellCard>();
            IEnemyComponent testSpellCardComponent       = testSpellCard.IntializeEnemyComponent();
            SpellCard       testSpellCardComponentCast   = (SpellCard)testSpellCardComponent;

            testSpellCardComponentCast.OnEnemyFinished += onSpellCardFinished;
            testSpellCardComponentCast.OnEnemyEnd      += onSpellCardEnded;
            testSpellCardComponentCast.ActiveEnemyComponent();

            yield return(new WaitForSecondsRealtime(1.5f));

            testSpellCardComponentCast.Health.DecreseHealth(100);

            testSpellCardComponentCast.DeactiveEnemyComponent();

            Debug.Log($"{isSpellCardFinished.ToString()} {isSpellCardEnded.ToString()}");
            Assert.That(isSpellCardFinished && isSpellCardEnded);
        }