Exemple #1
0
        public void TriggerTest()
        {
            Test(() =>
            {
                var effect = new ParticleEffect();
                effect.Trigger();
                Assert.AreEqual(1, effect.ActiveEmitters.Count);
                effect.Update(ElapsedTime);

                bool hasParticle = false;
                effect.ForEach((ref Particle particle) => { hasParticle = true; });

                Assert.IsTrue(hasParticle);
            });
        }
Exemple #2
0
        public void DefaultConstructorTest()
        {
            Test(() =>
            {
                var effect = new ParticleEffect();

                Assert.AreEqual(true, effect.Enabled);
                Assert.AreEqual(false, effect.DepthSortEnabled);
                Assert.AreEqual(BlendState.Additive, effect.BlendState);
                Assert.AreEqual(0, effect.ActiveEmitters.Count);
                Assert.IsNotNull(effect.Emitter);

                effect.Update(ElapsedTime);

                bool hasParticle = false;
                effect.ForEach((ref Particle particle) => { hasParticle = true; });

                Assert.IsFalse(hasParticle);
            });
        }