|
|
|
@ -52,21 +52,24 @@ namespace UnitTesting
|
|
|
|
|
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);
|
|
|
|
|
int? joueurCourantAvant = (int?) fieldInfo.GetValue(regles);
|
|
|
|
|
Assert.NotNull(joueurCourantAvant);
|
|
|
|
|
Assert.Equal(0, joueurCourantAvant);
|
|
|
|
|
|
|
|
|
|
regles.PasserLaMain();
|
|
|
|
|
|
|
|
|
|
joueurCourant = (int?)fieldInfo.GetValue(regles);
|
|
|
|
|
Assert.NotNull(joueurCourant);
|
|
|
|
|
Assert.Equal(1, joueurCourant);
|
|
|
|
|
int? joueurCourantApres = (int?)fieldInfo.GetValue(regles);
|
|
|
|
|
Assert.NotNull(joueurCourantApres);
|
|
|
|
|
Assert.Equal(1, joueurCourantApres);
|
|
|
|
|
Assert.NotEqual(joueurCourantAvant, joueurCourantApres);
|
|
|
|
|
|
|
|
|
|
regles.PasserLaMain();
|
|
|
|
|
|
|
|
|
|
joueurCourant = (int?)fieldInfo.GetValue(regles);
|
|
|
|
|
Assert.NotNull(joueurCourant);
|
|
|
|
|
Assert.Equal(0, joueurCourant);
|
|
|
|
|
int? joueurCourantBoucle = (int?)fieldInfo.GetValue(regles);
|
|
|
|
|
Assert.NotNull(joueurCourantBoucle);
|
|
|
|
|
Assert.Equal(0, joueurCourantBoucle);
|
|
|
|
|
Assert.NotEqual(joueurCourantApres, joueurCourantBoucle);
|
|
|
|
|
Assert.Equal(joueurCourantAvant, joueurCourantBoucle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|