You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.2 KiB
45 lines
1.2 KiB
using CoreLibrary.Core;
|
|
using CoreLibrary.Joueurs;
|
|
using Xunit;
|
|
|
|
namespace UnitTesting
|
|
{
|
|
public class JoueurUT
|
|
{
|
|
[Fact]
|
|
public void TestConstructeur1Valide()
|
|
{
|
|
string nom = "toto";
|
|
|
|
Joueur joueur = new Joueur(nom);
|
|
|
|
|
|
Assert.Equal(nom, joueur.Nom);
|
|
Assert.Equal(0, joueur.NbCoutTotal);
|
|
Assert.Equal(0, joueur.NbPartieGagnee);
|
|
Assert.Equal(0, joueur.NbPartieEgalite);
|
|
Assert.Equal(0, joueur.NbPartiePerdue);
|
|
}
|
|
|
|
|
|
[Fact]
|
|
public void TestConstructeur2Valide()
|
|
{
|
|
string nom = "Bob";
|
|
int nbCoutTotal = 10;
|
|
int nbPartieGagnee = 5;
|
|
int nbPartieEgalite = 2;
|
|
int nbPartiePerdue = 3;
|
|
|
|
Joueur joueur = new Joueur(nom, nbCoutTotal, nbPartieGagnee, nbPartieEgalite, nbPartiePerdue);
|
|
|
|
Assert.Equal(nom, joueur.Nom);
|
|
Assert.Equal(nbCoutTotal, joueur.NbCoutTotal);
|
|
Assert.Equal(nbPartieGagnee, joueur.NbPartieGagnee);
|
|
Assert.Equal(nbPartieEgalite, joueur.NbPartieEgalite);
|
|
Assert.Equal(nbPartiePerdue, joueur.NbPartiePerdue);
|
|
}
|
|
|
|
}
|
|
}
|