passer la main
continuous-integration/drone/push Build is passing Details

master
Céleste BARBOSA 11 months ago
parent b8d3ba4b7f
commit 527f7003a0

@ -52,21 +52,24 @@ namespace UnitTesting
FieldInfo? fieldInfo = type.GetField("joueurCourant", BindingFlags.NonPublic | BindingFlags.Instance); FieldInfo? fieldInfo = type.GetField("joueurCourant", BindingFlags.NonPublic | BindingFlags.Instance);
Assert.NotNull(fieldInfo); Assert.NotNull(fieldInfo);
int? joueurCourant = (int?) fieldInfo.GetValue(regles); int? joueurCourantAvant = (int?) fieldInfo.GetValue(regles);
Assert.NotNull(joueurCourant); Assert.NotNull(joueurCourantAvant);
Assert.Equal(0, joueurCourant); Assert.Equal(0, joueurCourantAvant);
regles.PasserLaMain(); regles.PasserLaMain();
joueurCourant = (int?)fieldInfo.GetValue(regles); int? joueurCourantApres = (int?)fieldInfo.GetValue(regles);
Assert.NotNull(joueurCourant); Assert.NotNull(joueurCourantApres);
Assert.Equal(1, joueurCourant); Assert.Equal(1, joueurCourantApres);
Assert.NotEqual(joueurCourantAvant, joueurCourantApres);
regles.PasserLaMain(); regles.PasserLaMain();
joueurCourant = (int?)fieldInfo.GetValue(regles); int? joueurCourantBoucle = (int?)fieldInfo.GetValue(regles);
Assert.NotNull(joueurCourant); Assert.NotNull(joueurCourantBoucle);
Assert.Equal(0, joueurCourant); Assert.Equal(0, joueurCourantBoucle);
Assert.NotEqual(joueurCourantApres, joueurCourantBoucle);
Assert.Equal(joueurCourantAvant, joueurCourantBoucle);
} }
[Fact] [Fact]

Loading…
Cancel
Save