public virtual void testCollideMeteorWithBullet() { MeteorImpl meteorimpl = new MeteorImpl(new Pair <int, int>(0, 0), 1, 1, LENGTH, ID.METEOR); BulletImpl bulletplayer = new BulletImpl(0, 0, ID.PLAYER_BULLET); meteorimpl.collide(bulletplayer); Assert.IsFalse(meteorimpl.Dead); meteorimpl.collide(bulletplayer); meteorimpl.collide(bulletplayer); Assert.IsTrue(meteorimpl.Dead); }
public void testMeteor() { MeteorImpl meteorimpl = new MeteorImpl(new Pair <int, int>(0, 0), 1, 1, LENGTH, ID.METEOR); meteorimpl.update(); meteorimpl.setSpeed(1, 1); meteorimpl.update(); meteorimpl.setSpeed(1, 1); meteorimpl.update(); Assert.AreEqual(Convert.ToInt32(meteorimpl.Position.GetX()), XEXPECTED); Assert.AreEqual(Convert.ToInt32(meteorimpl.Position.GetY()), YEXPECTED); }