Modification noms des fonctions tests
continuous-integration/drone/push Build is passing Details

master
Pauline PRADY 1 year ago
parent 65ecbf1e0d
commit 3a60868f0e

@ -7,7 +7,7 @@ namespace UnitTesting
public class CodeUT
{
[Fact]
public void TestFirstConstructorValidArguments()
public void TestPremierConstructeurValide()
{
Code code = new Code(4);
Assert.NotNull(code);
@ -16,14 +16,14 @@ namespace UnitTesting
}
[Fact]
public void TestConstructorInvalidArguments()
public void TestPremierConstructeurInvalide()
{
Assert.Throws<TailleCodeException>(() => new Code(0));
Assert.Throws<TailleCodeException>(() => new Code(-1));
}
[Fact]
public void TestSecondConstructorValidArguments()
public void TestDeuxiemeConstructeurValide()
{
Jeton[] jetons = [new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLEU), new Jeton(Couleur.BLEU)];
@ -34,13 +34,13 @@ namespace UnitTesting
}
[Fact]
public void TestSecondConstructorInvalidArguments()
public void TestDeuxiemeConstructeurInvalide()
{
Assert.Throws<TailleCodeException>(() => new Code([]));
}
[Fact]
public void TestAjouterJetonValid()
public void TestAjouterJetonValide()
{
Jeton jeton = new Jeton(Couleur.JAUNE);
Code code = new Code(3);
@ -50,14 +50,14 @@ namespace UnitTesting
}
[Fact]
public void TestAjouterJetonInvalid()
public void TestAjouterJetonInvalide()
{
Code code = new Code([new Jeton(Couleur.NOIR)]);
Assert.Throws<CodeCompletException>(() => code.AjouterJeton(new Jeton(Couleur.ROUGE)));
}
[Fact]
public void TestSupprimerDernierJetonValid()
public void TestSupprimerDernierJetonValide()
{
Code code = new Code([new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLEU), new Jeton(Couleur.BLANC)]);
code.SupprimerDernierJeton();
@ -65,14 +65,14 @@ namespace UnitTesting
}
[Fact]
public void TestSupprimerDernierJetonInvalid()
public void TestSupprimerDernierJetonInvalide()
{
Code code = new Code(4);
Assert.Throws<CodeVideException>(() => code.SupprimerDernierJeton());
}
[Fact]
public void TestRecupererJetonValid()
public void TestRecupererJetonValide()
{
Code code = new Code([new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLEU), new Jeton(Couleur.BLANC)]);
Jeton jetonAttendu = new Jeton(Couleur.BLEU);
@ -81,7 +81,7 @@ namespace UnitTesting
}
[Fact]
public void TestRecupererJetonInvalid()
public void TestRecupererJetonInvalide()
{
Code code = new Code(4);
Assert.Throws<IndiceCodeException>(() => code.RecupererJeton(-1));
@ -96,7 +96,7 @@ namespace UnitTesting
}
[Fact]
public void TestJetonsValid()
public void TestJetonsValide()
{
Jeton[] jetonsAttendus = [new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLEU), new Jeton(Couleur.BLEU)];
Code code = new Code(jetonsAttendus);
@ -113,7 +113,7 @@ namespace UnitTesting
}
[Fact]
public void TestEstCompletValid()
public void TestEstCompletValide()
{
Code code = new Code([new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLEU), new Jeton(Couleur.BLANC)]);
bool estComplet = code.EstComplet();
@ -121,7 +121,7 @@ namespace UnitTesting
}
[Fact]
public void TestEstCompletInvalid()
public void TestEstCompletInvalide()
{
Code code = new Code(3);
bool estComplet = code.EstComplet();
@ -129,7 +129,7 @@ namespace UnitTesting
}
[Fact]
public void TestTailleMaximaleValid()
public void TestTailleMaximaleValide()
{
Jeton[] jetons = [new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLEU), new Jeton(Couleur.BLEU)];
Code code = new Code(jetons);

@ -6,7 +6,7 @@ namespace UnitTesting
public class JetonUT
{
[Fact]
public void TestConstructorValid()
public void TestConstructeurValide()
{
Couleur[] listeCouleurs = (Couleur[])Enum.GetValues(typeof(Couleur));

@ -6,7 +6,7 @@ namespace UnitTesting
public class JoueurUT
{
[Fact]
public void TestConstructorWithValidArguments()
public void TestConstructeurValide()
{
Plateau plateau = new Plateau(4, 10);
Joueur joueur = new Joueur("MonJoueur", plateau);

@ -0,0 +1,33 @@
using CoreLibrary;
using CoreLibrary.Exceptions;
using System.Reflection;
using Xunit;
namespace UnitTesting
{
public class PartieUT
{
[Fact]
public void TestJouer()
{
//ReglesClassiques regles = new ReglesClassiques();
//Partie partie = new Partie(regles);
//partie.Jouer();
//Assert.True(regles.EstTerminee());
//IEnumerable<Joueur> gagnants = regles.Gagnants();
//IEnumerable<Joueur> perdants = regles.Perdants();
//Assert.NotEmpty(gagnants);
//Assert.All(gagnants, joueur => Assert.DoesNotContain(joueur, perdants));
//foreach (var joueur in regles.joueurs())
//{
//Assert.NotNull(joueur.Plateau);
//Assert.True(joueur.Plateau.EstComplet());
//}
}
}
}

@ -8,7 +8,7 @@ namespace UnitTesting
public class PlateauUT
{
[Fact]
public void TestConstructorValid()
public void TestConstructeurValide()
{
Plateau plateau = new Plateau(4,12);
Assert.NotNull(plateau);
@ -17,7 +17,7 @@ namespace UnitTesting
}
[Fact]
public void TestConstructorInvalid()
public void TestConstructeurInvalide()
{
Assert.Throws<TailleCodeException>(() => new Plateau(0, 10));
Assert.Throws<TailleGrilleException>(() => new Plateau(3, 0));
@ -193,7 +193,7 @@ namespace UnitTesting
}
[Fact]
public void TestGrilleValid()
public void TestGrilleValide()
{
Plateau plateau = new Plateau(4, 3);
Code code1 = new Code([new Jeton(Couleur.BLEU), new Jeton(Couleur.BLANC), new Jeton(Couleur.JAUNE), new Jeton(Couleur.BLANC)]);
@ -212,7 +212,7 @@ namespace UnitTesting
}
[Fact]
public void TestGrilleEmpty()
public void TestGrilleVide()
{
Plateau plateau = new Plateau(4, 3);

@ -14,7 +14,7 @@ namespace UnitTesting
Assert.Equal("Règles classiques", regle.Nom);
}
[Fact]
public void TestConstructor()
public void TestConstructeur()
{
ReglesClassiques regles = new ReglesClassiques();
@ -34,7 +34,7 @@ namespace UnitTesting
}
[Fact]
public void TestJoueurCourantWithPlayer()
public void TestJoueurCourantAvecJoueur()
{
ReglesClassiques regles = new ReglesClassiques();
regles.AjouterJoueur("joueur1");
@ -48,14 +48,14 @@ namespace UnitTesting
}
[Fact]
public void TestJoueurCourantNoPlayer()
public void TestJoueurCourantSansJoueur()
{
ReglesClassiques regles = new ReglesClassiques();
Assert.Throws<PartieNonCommenceeException>(() => regles.JoueurCourant());
}
[Fact]
public void TestPasserLaMainValid()
public void TestPasserLaMainValide()
{
ReglesClassiques regles = new ReglesClassiques();
regles.AjouterJoueur("joueur1");
@ -93,7 +93,7 @@ namespace UnitTesting
}
[Fact]
public void TestPasserLaMainInvalid()
public void TestPasserLaMainInvalide()
{
ReglesClassiques regles = new ReglesClassiques();
Assert.Throws<PartieNonCommenceeException>(() => regles.PasserLaMain());

@ -23,6 +23,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ConsoleApp\ConsoleApp.csproj" />
<ProjectReference Include="..\CoreLibrary\CoreLibrary.csproj" />
</ItemGroup>

Loading…
Cancel
Save