public void TestMoveNoException() { Hero hero = new Hero(3, 4, Corridor.Constants.FieldSize); hero.Move(1, 0); Assert.AreEqual(4, hero.X); hero.Move(0, 1); hero.Move(0, 1); hero.Move(0, 1); Assert.AreEqual(7, hero.Y); hero.Move(-1, 0); Assert.AreEqual(3, hero.X); hero.Move(0, -1); Assert.AreEqual(6, hero.Y); }
public void TestMoveExceptionBothNotZero() { Hero hero = new Hero(2, 2, Corridor.Constants.FieldSize); hero.Move(1, 1); }
public void TestMoveExceptionStride2() { Hero hero = new Hero(2, 2, Corridor.Constants.FieldSize); hero.Move(0, -2); }
public bool MoveHeroTest(Hero hero, int dx, int dy) { bool canMoveHero = CanMove(hero.X, hero.Y, dx, dy); if (canMoveHero) { hero.Move(dx, dy); } return canMoveHero; }