|
|
|
@ -67,35 +67,44 @@ namespace UnitTesting
|
|
|
|
|
|
|
|
|
|
Dictionary<string, bool>? joueursCopie = joueursField.GetValue(partieCopiee) as Dictionary<string, bool>;
|
|
|
|
|
List<Plateau>? plateauxCopie = plateauxField.GetValue(partieCopiee) as List<Plateau>;
|
|
|
|
|
int? courantCopie = courantField.GetValue(partieCopiee) as int?;
|
|
|
|
|
int? tourCopie = tourField.GetValue(partieCopiee) as int?;
|
|
|
|
|
bool? termineCopie = termineField.GetValue(partieCopiee) as bool?;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (joueursCopie != null && plateauxCopie != null && courantCopie != null && tourCopie != null && termineCopie != null && joueurs != null && plateaux != null)
|
|
|
|
|
if (courantField != null && tourField != null && termineField != null)
|
|
|
|
|
{
|
|
|
|
|
Assert.Equal(joueurs.Count, joueursCopie.Count);
|
|
|
|
|
Assert.Equal(plateaux.Count, plateauxCopie.Count);
|
|
|
|
|
Assert.Equal(5, tourCopie.Value);
|
|
|
|
|
Assert.False(termineCopie.Value);
|
|
|
|
|
Assert.Equal(regles, partieCopiee.Regles);
|
|
|
|
|
}
|
|
|
|
|
int? courantCopie = courantField.GetValue(partieCopiee) as int?;
|
|
|
|
|
int? tourCopie = tourField.GetValue(partieCopiee) as int?;
|
|
|
|
|
bool? termineCopie = termineField.GetValue(partieCopiee) as bool?;
|
|
|
|
|
|
|
|
|
|
foreach (String joueur in joueurs.Keys)
|
|
|
|
|
{
|
|
|
|
|
if(joueursCopie != null)
|
|
|
|
|
|
|
|
|
|
if (joueursCopie != null && plateauxCopie != null && courantCopie != null && tourCopie != null && termineCopie != null && joueurs != null && plateaux != null)
|
|
|
|
|
{
|
|
|
|
|
Assert.True(joueursCopie.ContainsKey(joueur));
|
|
|
|
|
Assert.Equal(joueurs[joueur], joueursCopie[joueur]);
|
|
|
|
|
Assert.Equal(joueurs.Count, joueursCopie.Count);
|
|
|
|
|
Assert.Equal(plateaux.Count, plateauxCopie.Count);
|
|
|
|
|
Assert.Equal(5, tourCopie.Value);
|
|
|
|
|
Assert.False(termineCopie.Value);
|
|
|
|
|
Assert.Equal(regles, partieCopiee.Regles);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (joueurs != null && joueursCopie != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (string joueur in joueurs.Keys)
|
|
|
|
|
{
|
|
|
|
|
Assert.True(joueursCopie.ContainsKey(joueur));
|
|
|
|
|
Assert.Equal(joueurs[joueur], joueursCopie[joueur]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (plateaux != null && plateauxCopie != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (Plateau plateau in plateaux)
|
|
|
|
|
{
|
|
|
|
|
Assert.Contains(plateau, plateauxCopie);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (Plateau plateau in plateaux)
|
|
|
|
|
{
|
|
|
|
|
if (plateauxCopie != null)
|
|
|
|
|
Assert.Contains(plateau, plateauxCopie);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|