code smell
continuous-integration/drone/push Build is passing Details

master
parent b1b19c77f5
commit e9402b247c

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

Loading…
Cancel
Save