|
|
|
@ -4,6 +4,7 @@ using CoreLibrary.Joueurs;
|
|
|
|
|
using CoreLibrary.Manageurs;
|
|
|
|
|
using CoreLibrary.Persistance;
|
|
|
|
|
using CoreLibrary.Regles;
|
|
|
|
|
using CoreLibrary.Statistiques;
|
|
|
|
|
using Persistance.Persistance;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using Xunit;
|
|
|
|
@ -153,6 +154,27 @@ namespace UnitTesting
|
|
|
|
|
Assert.NotEmpty(PartieDemanderJoueurJouer.GetInvocationList());
|
|
|
|
|
Assert.NotEmpty(PartiePasserLaMain.GetInvocationList());
|
|
|
|
|
Assert.NotEmpty(PartiePartieTerminee.GetInvocationList());
|
|
|
|
|
|
|
|
|
|
Joueur celeste = manageur.DemanderJoueur("Céleste");
|
|
|
|
|
Robot robot = new Robot();
|
|
|
|
|
|
|
|
|
|
Assert.Equal(0, celeste.Statistique(new ReglesClassiques(), Statistique.CoupMoyen));
|
|
|
|
|
Assert.Equal(0, celeste.Statistique(new ReglesClassiques(), Statistique.PartieGagnee));
|
|
|
|
|
Assert.Equal(0, celeste.Statistique(new ReglesClassiques(), Statistique.PartieEgalite));
|
|
|
|
|
Assert.Equal(0, celeste.Statistique(new ReglesClassiques(), Statistique.PartiePerdue));
|
|
|
|
|
|
|
|
|
|
int tour = 10;
|
|
|
|
|
IReadOnlyList<string> gagnants = [celeste.Nom];
|
|
|
|
|
IReadOnlyList<string> perdants = [robot.Nom];
|
|
|
|
|
|
|
|
|
|
PartiePartieTerminee.Invoke(null, new PartiePartieTermineeEventArgs(
|
|
|
|
|
tour, gagnants, perdants
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
Assert.Equal(tour, celeste.Statistique(new ReglesClassiques(), Statistique.CoupMoyen));
|
|
|
|
|
Assert.Equal(1, celeste.Statistique(new ReglesClassiques(), Statistique.PartieGagnee));
|
|
|
|
|
Assert.Equal(0, celeste.Statistique(new ReglesClassiques(), Statistique.PartieEgalite));
|
|
|
|
|
Assert.Equal(0, celeste.Statistique(new ReglesClassiques(), Statistique.PartiePerdue));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|