Namespace: SideScroller
Assembly: SideScroller (in SideScroller.exe) Version: 1.1.1.0 (1.1.1)
Tests: SideScroller.Tests.EnemyPlaneTests
2 unit tests call SideScroller.Plane.Hitpoints
Assembly: SideScroller (in SideScroller.exe) Version: 1.1.1.0 (1.1.1)
Syntax
Property Value
Type: Int32Remarks
Examples
[Test] public void LowerLifeWhenHitByBullet() { enemy = new EnemyPlane(new Vector2D(1.2f, 0.5f)); Assert.AreEqual(5, enemy.Hitpoints); enemy.CheckIfHitAndReact(new Vector2D(1.2f, 0.5f)); Assert.AreEqual(4, enemy.Hitpoints); }
[Test] public void DefeatEnemyPlane() { enemy = new EnemyPlane(new Vector2D(1.2f, 0.9f)); bool defeated = false; enemy.Destroyed += () => { defeated = true; }; enemy.ReceiveAttack(5); Assert.LessOrEqual(enemy.Hitpoints, 0); Assert.IsTrue(defeated); }
See Also