|
|
|
@ -1,4 +1,6 @@
|
|
|
|
|
using System;
|
|
|
|
|
using Models;
|
|
|
|
|
using Models.Jeux;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
@ -8,10 +10,84 @@ namespace TestUnit
|
|
|
|
|
{
|
|
|
|
|
public class DisplayTests
|
|
|
|
|
{
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestAfficherPlateau()
|
|
|
|
|
{
|
|
|
|
|
Display d = new Display();
|
|
|
|
|
Joueur joueur1 = new Joueur();
|
|
|
|
|
Joueur joueur2 = new Joueur();
|
|
|
|
|
Partie partie = new Partie(joueur1, joueur2);
|
|
|
|
|
|
|
|
|
|
partie.Plateau.ShowingBoard += d.AfficherPlateau;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.NotNull(d);
|
|
|
|
|
Assert.NotNull(d.AfficherPlateau);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestFaireCoup()
|
|
|
|
|
{
|
|
|
|
|
Display d = new Display();
|
|
|
|
|
Joueur joueur1 = new Joueur();
|
|
|
|
|
Joueur joueur2 = new Joueur();
|
|
|
|
|
Partie partie = new Partie(joueur1, joueur2);
|
|
|
|
|
|
|
|
|
|
partie.Plateau.MovingPawn += d.faireCoup;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.NotNull(d.faireCoup);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestAfficherNomJoueur()
|
|
|
|
|
{
|
|
|
|
|
Display d = new Display();
|
|
|
|
|
Joueur joueur1 = new Joueur();
|
|
|
|
|
Joueur joueur2 = new Joueur();
|
|
|
|
|
Partie partie = new Partie(joueur1, joueur2);
|
|
|
|
|
|
|
|
|
|
partie.JoueurCourrant.ShowingPlayerName += d.AfficherNomJoueur;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.NotNull(d.AfficherNomJoueur);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestEntrerNomJoueur()
|
|
|
|
|
{
|
|
|
|
|
Display d = new Display();
|
|
|
|
|
Joueur joueur1 = new Joueur();
|
|
|
|
|
Joueur joueur2 = new Joueur();
|
|
|
|
|
Partie partie = new Partie(joueur1, joueur2);
|
|
|
|
|
|
|
|
|
|
joueur1.EnterPlayerName += d.EntrerNoms;
|
|
|
|
|
joueur2.EnterPlayerName += d.EntrerNoms;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.NotNull(d.EntrerNoms);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestAfficherGagnant()
|
|
|
|
|
{
|
|
|
|
|
Display d = new Display();
|
|
|
|
|
Joueur joueur1 = new Joueur();
|
|
|
|
|
Joueur joueur2 = new Joueur();
|
|
|
|
|
Partie partie = new Partie(joueur1, joueur2);
|
|
|
|
|
|
|
|
|
|
partie.ShowingWinner += d.AfficherGagnant;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.NotNull(d.AfficherGagnant);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|