TestPasserLaMain
continuous-integration/drone/push Build is failing Details

master
Céleste BARBOSA 11 months ago
parent c0591d7eb4
commit 202cb64d8f

@ -30,6 +30,37 @@ namespace UnitTesting
Assert.Throws<PartieNonCommenceeException>(() => regles.PasserLaMain());
}
[Fact]
public void TestPasserLaMain()
{
ReglesClassiques regles = new ReglesClassiques();
regles.AjouterJoueur("céleste");
regles.AjouterJoueur("pauline");
regles.CommencerLaPartie();
Type type = typeof(ReglesClassiques);
FieldInfo? fieldInfo = type.GetField("joueurCourant", BindingFlags.NonPublic | BindingFlags.Instance);
Assert.NotNull(fieldInfo);
int? joueurCourant = (int?) fieldInfo.GetValue(regles);
Assert.NotNull(joueurCourant);
Assert.Equal(0, joueurCourant);
regles.PasserLaMain();
joueurCourant = (int?)fieldInfo.GetValue(regles);
Assert.NotNull(joueurCourant);
Assert.Equal(1, joueurCourant);
regles.PasserLaMain();
joueurCourant = (int?)fieldInfo.GetValue(regles);
Assert.NotNull(joueurCourant);
Assert.Equal(0, joueurCourant)
}
[Fact]
public void TestEstTermineeVictoire()
{

Loading…
Cancel
Save