You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mastermind/Sources/ConsoleApp1/Program.cs

27 lines
974 B

// Cas 3 - Plateau rempli, code mauvaise couleur
using CoreLibrary.Core;
using System.Reflection;
Code code3 = new Code(1);
code3.AjouterJeton(new Jeton(Couleur.Rouge));
Plateau plateau3;
Code? codeSecret3;
do
{
plateau3 = new Plateau(1, 1);
FieldInfo? codeSecretInfo3 = typeof(Plateau).GetField("codeSecret", BindingFlags.NonPublic | BindingFlags.Instance);
codeSecret3 = codeSecretInfo3.GetValue(plateau2) as Code;
Assert.NotNull(codeSecret3);
} while (codeSecret3.RecupererJeton(0).Equals(code3.RecupererJeton(0)));
plateau3.AjouterCode(codeSecret3);
MethodInfo? EstCodePossible3 = typeof(Robot).GetMethod("EstCodePossible", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
Assert.NotNull(EstCodePossible3);
object? estPossibleObj3 = EstCodePossible3.Invoke(new Robot(), [plateau3, code3]);
Assert.NotNull(estPossibleObj3);
Assert.IsType<bool>(estPossibleObj3);
Assert.False((bool)estPossibleObj3);