public void TestSensVerticalBas() { Position positionTest = new Position(2, 5); SensV sensHorizontal = positionDeReference.SensVertical(positionTest); Assert.AreEqual(SensV.BAS, sensHorizontal); }
public void TestSensVerticalHaut() { Position positionTest = new Position(2, -5); SensV sensHorizontal = positionDeReference.SensVertical(positionTest); Assert.AreEqual(SensV.HAUT, sensHorizontal); }
public void TestSensVerticalNul() { Position positionTest = new Position(); SensV sensHorizontal = positionDeReference.SensVertical(positionTest); Assert.AreEqual(SensV.NUL, sensHorizontal); }
public void DirectionsTestCreationVertical() { sensVertical = SensV.NUL; Directions direction = new Directions(); Assert.AreEqual(sensVertical, direction.sensVertical); }
public void DirectionsTestVerticalNul() { sensHorizontal = SensH.NUL; sensVertical = SensV.NUL; Directions direction = new Directions(sensHorizontal, sensVertical); Assert.AreEqual(sensVertical, direction.sensVertical); }
public void DirectionsTestDirectionHautGaucheVertical() { Random rand = new Random(); sensVertical = SensV.HAUT; sensHorizontal = SensH.GAUCHE; Directions direction = new Directions(sensHorizontal, sensVertical); Assert.AreEqual(sensVertical, direction.sensVertical); }
public void DirectionsTestDirectionDroiteVertical() { Random rand = new Random(); sensVertical = SensV.NUL; sensHorizontal = SensH.DROITE; Directions direction = new Directions(sensHorizontal, sensVertical); Assert.AreEqual(sensVertical, direction.sensVertical); }
public void DirectionsTestDirectionBasVertical() { Random rand = new Random(); sensVertical = SensV.BAS; sensHorizontal = SensH.NUL; Directions direction = new Directions(sensHorizontal, sensVertical); Assert.AreEqual(sensVertical, direction.sensVertical); }
public void PositionTestChangeYLimitePasHaut() { Position position = new Position(0, 3); int positionYDepart = position.Y; SensV p_sens = SensV.HAUT; int p_pas = 5; int p_limite = 0; position.ChangeY(p_sens, p_pas, p_limite); Assert.AreEqual(positionYDepart, position.Y); }
public void PositionTestChangeYBas() { Position position = new Position(); int positionYDepart = position.Y; SensV p_sens = SensV.BAS; int p_pas = 1; int p_limite = 0; position.ChangeY(p_sens, p_pas, p_limite); Assert.AreEqual(positionYDepart + p_pas, position.Y); }
public void PositionTestChangeYLimitePasBas() { Position position = new Position(1, 6); int positionYDepart = position.Y; SensV p_sens = SensV.BAS; int p_pas = 5; int p_limite = 10; position.ChangeY(p_sens, p_pas, p_limite); Assert.AreEqual(positionYDepart, position.Y); }
public void PositionTestChangePositionAleatoire() { Position position1 = new Position(); Random rand = new Random(); SensH sensHorizontal = SensH.NUL; SensV sensVertical = SensV.NUL; int horizontal = rand.Next(3); int vertical = rand.Next(3); switch (horizontal) { case 1: sensHorizontal = SensH.DROITE; break; case 2: sensHorizontal = SensH.GAUCHE; break; } switch (vertical) { case 1: sensVertical = SensV.HAUT; break; case 2: sensVertical = SensV.BAS; break; } int p_pas = 1; int p_limite = 0; Directions direction = new Directions(sensHorizontal, sensVertical); position1.ChangePosition(direction, p_pas, p_limite); Position positionDeReference = new Position(); if (sensHorizontal == SensH.NUL && sensVertical == SensV.NUL) { Assert.AreEqual(positionDeReference, position1); } else { Assert.AreNotEqual(positionDeReference, position1); } }
public void PositionTestChangePositionDroite() { Position position1 = new Position(1, 2); Random rand = new Random(); SensH sensHorizontal = SensH.DROITE; SensV sensVertical = SensV.NUL; int p_pas = 1; int p_limite = 0; Directions direction = new Directions(sensHorizontal, sensVertical); position1.ChangePosition(direction, p_pas, p_limite); Assert.AreEqual(positionDeReference, position1); }
public void PositionTestChangePositionBasGauche() { Position position1 = new Position(3, 1); Random rand = new Random(); SensH sensHorizontal = SensH.GAUCHE; SensV sensVertical = SensV.BAS; int p_pas = 1; int p_limite = 0; Directions direction = new Directions(sensHorizontal, sensVertical); position1.ChangePosition(direction, p_pas, p_limite); Assert.AreEqual(positionDeReference, position1); }
public void PositionTestChangePositionLimiteHautGauche() { Position position1 = new Position(3, 3); Position position2 = new Position(3, 3); Random rand = new Random(); SensH sensHorizontal = SensH.GAUCHE; SensV sensVertical = SensV.HAUT; int p_pas = 25; int p_limite = 10; Directions direction = new Directions(sensHorizontal, sensVertical); position1.ChangePosition(direction, p_pas, p_limite); Assert.AreEqual(position2, position1); }
public void PositionTestChangePositionLimiteBas() { Position position1 = new Position(2, 1); Position position2 = new Position(2, 1); Random rand = new Random(); SensH sensHorizontal = SensH.NUL; SensV sensVertical = SensV.BAS; int p_pas = 25; int p_limite = 10; Directions direction = new Directions(sensHorizontal, sensVertical); position1.ChangePosition(direction, p_pas, p_limite); Assert.AreEqual(position2, position1); }
public void DirectionsTestVerticalAleatoire() { Random r = new Random(); sensHorizontal = SensH.NUL; sensVertical = SensV.NUL; switch (r.Next(3)) { case 1: sensVertical = SensV.HAUT; break; case 2: sensVertical = SensV.BAS; break; } Directions direction = new Directions(sensHorizontal, sensVertical); Assert.AreEqual(sensVertical, direction.sensVertical); }
public void DirectionsTestTous() { Random rand = new Random(); int vertical = rand.Next(3); sensVertical = SensV.NUL; switch (vertical) { case 1: sensVertical = SensV.HAUT; break; case 2: sensVertical = SensV.BAS; break; } Directions direction = new Directions(sensHorizontal, sensVertical); Assert.AreEqual(sensVertical, direction.sensVertical); }
public Directions(SensH sensHorizontal = SensH.NUL, SensV sensVertical = SensV.NUL) { this.sensHorizontal = sensHorizontal; this.sensVertical = sensVertical; }
public Directions(bool aleatoire = false) { sensHorizontal = SensH.NUL; sensVertical = SensV.NUL; }
public Directions() { sensHorizontal = SensH.NUL; sensVertical = SensV.NUL; }