Exemplo n.º 1
0
        public void BulletInteractionTest()
        {
            AEntity testedBullet = new LaserBullet(new CoupleDouble(1, 1), new CoupleDouble(1, 1), new CoupleDouble(-1, -1));

            GunBullet someGunBullet   = new GunBullet(new CoupleDouble(1, 1), new CoupleDouble(1, 1), new CoupleDouble(-1, -1));
            AEntity   someLaserBullet = new LaserBullet(new CoupleDouble(1, 1), new CoupleDouble(1, 1), new CoupleDouble(-1, -1));

            List <AEntity> gunBullIntRes   = testedBullet.Interaction(someGunBullet);
            List <AEntity> laserBullIntRes = testedBullet.Interaction(someLaserBullet);


            Assert.AreEqual(null, gunBullIntRes);
            Assert.AreEqual(null, laserBullIntRes);

            Assert.IsTrue(testedBullet.WasKilled);
        }
Exemplo n.º 2
0
        public void EnemyInteractionTest()
        {
            AEntity firstTestedLaserBullet  = new LaserBullet(new CoupleDouble(1, 1), new CoupleDouble(1, 1), new CoupleDouble(-1, -1));
            AEntity secondTestedLaserBullet = new LaserBullet(new CoupleDouble(2, 2), new CoupleDouble(2, 2), new CoupleDouble(-1, -1));

            Ufo      someUfo      = new Ufo(new CoupleDouble(1, 1), new CoupleDouble(1, 1), new CoupleDouble(-1, -1));
            Asteroid someAsteroid = new Asteroid(new CoupleDouble(2, 2), new CoupleDouble(2, 2), new CoupleDouble(-1, -1));

            List <AEntity> interUfoResult    = firstTestedLaserBullet.Interaction(someUfo);
            List <AEntity> interaAsterResult = secondTestedLaserBullet.Interaction(someAsteroid);

            Assert.AreEqual(null, interUfoResult);
            Assert.AreEqual(null, interaAsterResult);

            Assert.IsTrue(firstTestedLaserBullet.WasKilled);
            Assert.IsTrue(secondTestedLaserBullet.WasKilled);
        }