Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 public void TestMoveExceptionBothNotZero()
 {
     Hero hero = new Hero(2, 2, Corridor.Constants.FieldSize);
     hero.Move(1, 1);
 }
Esempio n. 3
0
 public void TestMoveExceptionStride2()
 {
     Hero hero = new Hero(2, 2, Corridor.Constants.FieldSize);
     hero.Move(0, -2);
 }
Esempio n. 4
0
 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;
 }