Tests unitaires des event args
continuous-integration/drone/push Build is passing Details

master
Céleste BARBOSA 12 months ago
parent ec59f2fcdb
commit e999c3f547

@ -0,0 +1,20 @@
using CoreLibrary;
using CoreLibrary.Events;
using Xunit;
namespace UnitTesting
{
public class AjouterJetonEventArgsUT
{
[Fact]
public void TestConstructeurValide()
{
Jeton monJeton = new Jeton(Couleur.JAUNE);
AjouterJetonEventArgs evenement = new AjouterJetonEventArgs(monJeton);
Assert.Equal(monJeton, evenement.Jeton);
}
}
}

@ -0,0 +1,20 @@
using CoreLibrary;
using CoreLibrary.Events;
using Xunit;
namespace UnitTesting
{
public class AjouterJoueurEventArgsUT
{
[Fact]
public void TestConstructeurValide()
{
Joueur monJoueur = new Joueur("Céleste", new Plateau(4, 12));
AjouterJoueursEventArgs evenement = new AjouterJoueursEventArgs(monJoueur);
Assert.Equal(monJoueur, evenement.Joueur);
}
}
}

@ -0,0 +1,18 @@
using CoreLibrary;
using CoreLibrary.Events;
using Xunit;
namespace UnitTesting
{
public class DemanderJoueurEventArgsUT
{
[Fact]
public void TestConstructeurValide()
{
DemanderJoueurEventArgs evenement = new DemanderJoueurEventArgs(3);
Assert.Equal(3, evenement.Numero);
}
}
}

@ -0,0 +1,25 @@
using CoreLibrary;
using CoreLibrary.Events;
using Xunit;
namespace UnitTesting
{
public class NouveauTourEventArgsUT
{
[Fact]
public void TestConstructeurValide()
{
Plateau monPlateau = new Plateau(4, 12);
Joueur monJoueur = new Joueur("Céleste", monPlateau);
NouveauTourEventArgs evenement =
new NouveauTourEventArgs(monJoueur, 5, monPlateau.Grille(), monPlateau.Indicateurs());
Assert.Equal(monJoueur, evenement.Joueur);
Assert.Equal(5, evenement.Tour);
Assert.Equal(monPlateau.Grille(), evenement.Grille);
Assert.Equal(monPlateau.Indicateurs(), evenement.Indicateurs);
}
}
}

@ -0,0 +1,23 @@
using CoreLibrary;
using CoreLibrary.Events;
using Xunit;
namespace UnitTesting
{
public class PartieTermineeEventArgsUT
{
[Fact]
public void TestConstructeurValide()
{
Plateau plateau = new Plateau(4, 12);
Joueur[] gagnants = [new Joueur("Pauline", plateau), new Joueur("Camille", plateau)];
Joueur[] perdants = [new Joueur("Céleste", plateau)];
PartieTermineeEventArgs evenement = new PartieTermineeEventArgs(gagnants, perdants);
Assert.Equal(gagnants, evenement.Gagnants);
Assert.Equal(perdants, evenement.Perdants);
}
}
}
Loading…
Cancel
Save