|
|
|
@ -139,7 +139,7 @@ namespace UnitTesting
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestComparerValid()
|
|
|
|
|
public void TestComparerValide()
|
|
|
|
|
{
|
|
|
|
|
Code code = new Code([new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLEU), new Jeton(Couleur.BLANC)]);
|
|
|
|
|
Code autreCode = new Code([new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLEU), new Jeton(Couleur.BLANC)]);
|
|
|
|
@ -152,7 +152,7 @@ namespace UnitTesting
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestComparerGoodPlace()
|
|
|
|
|
public void TestComparerBonnePlace()
|
|
|
|
|
{
|
|
|
|
|
Code code = new Code([new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLEU), new Jeton(Couleur.BLANC)]);
|
|
|
|
|
Code autreCode = new Code([new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLEU), new Jeton(Couleur.NOIR)]);
|
|
|
|
@ -165,7 +165,7 @@ namespace UnitTesting
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestComparerGoodColor()
|
|
|
|
|
public void TestComparerBonneCouleur()
|
|
|
|
|
{
|
|
|
|
|
Code code = new Code([new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLEU), new Jeton(Couleur.BLANC)]);
|
|
|
|
|
Code autreCode = new Code([new Jeton(Couleur.BLEU), new Jeton(Couleur.ROUGE), new Jeton(Couleur.NOIR)]);
|
|
|
|
@ -178,43 +178,40 @@ namespace UnitTesting
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestComparerBonnePlace()
|
|
|
|
|
public void TestComparerBonnePlaceEtCouleur()
|
|
|
|
|
{
|
|
|
|
|
Code code = new Code([new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLEU), new Jeton(Couleur.BLANC)]);
|
|
|
|
|
Code autreCode = new Code([new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLEU), new Jeton(Couleur.NOIR)]);
|
|
|
|
|
Code autreCode = new Code([new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLANC), new Jeton(Couleur.BLEU)]);
|
|
|
|
|
|
|
|
|
|
IEnumerable<Indicateur> indicateurs = code.Comparer(autreCode);
|
|
|
|
|
|
|
|
|
|
Assert.Equal(2, indicateurs.Count());
|
|
|
|
|
Assert.DoesNotContain(Indicateur.BONNECOULEUR, indicateurs);
|
|
|
|
|
Assert.Equal(3, indicateurs.Count());
|
|
|
|
|
Assert.Contains(Indicateur.BONNEPLACE, indicateurs);
|
|
|
|
|
Assert.Contains(Indicateur.BONNECOULEUR, indicateurs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestComparerGoodPlaceAndColor()
|
|
|
|
|
public void TestComparerDifferent()
|
|
|
|
|
{
|
|
|
|
|
Code code = new Code([new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLEU), new Jeton(Couleur.BLANC)]);
|
|
|
|
|
Code autreCode = new Code([new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLANC), new Jeton(Couleur.BLEU)]);
|
|
|
|
|
|
|
|
|
|
Code autreCode = new Code([new Jeton(Couleur.VERT), new Jeton(Couleur.JAUNE), new Jeton(Couleur.NOIR)]);
|
|
|
|
|
IEnumerable<Indicateur> indicateurs = code.Comparer(autreCode);
|
|
|
|
|
|
|
|
|
|
Assert.Equal(3, indicateurs.Count());
|
|
|
|
|
Assert.Contains(Indicateur.BONNEPLACE, indicateurs);
|
|
|
|
|
Assert.Contains(Indicateur.BONNECOULEUR, indicateurs);
|
|
|
|
|
Assert.Empty(indicateurs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestComparerNoMatch()
|
|
|
|
|
public void TestComparerMonCodeIncomplet()
|
|
|
|
|
{
|
|
|
|
|
Code code = new Code([new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLEU), new Jeton(Couleur.BLANC)]);
|
|
|
|
|
Code autreCode = new Code([new Jeton(Couleur.VERT), new Jeton(Couleur.JAUNE), new Jeton(Couleur.NOIR)]);
|
|
|
|
|
Code code = new Code(3);
|
|
|
|
|
Code autreCode = new Code([new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLEU), new Jeton(Couleur.BLANC)]);
|
|
|
|
|
IEnumerable<Indicateur> indicateurs = code.Comparer(autreCode);
|
|
|
|
|
|
|
|
|
|
Assert.Empty(indicateurs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestComparerCodeIncomplet()
|
|
|
|
|
public void TestComparerSonCodeIncomplet()
|
|
|
|
|
{
|
|
|
|
|
Code code = new Code([new Jeton(Couleur.ROUGE), new Jeton(Couleur.BLEU), new Jeton(Couleur.BLANC)]);
|
|
|
|
|
Code autreCode = new Code(3);
|
|
|
|
|