private void SecondPlayerStep() { var validatorMinMax = new ValidatorMinMax(Min, Max); Console.Clear(); Console.WriteLine($"Wait {Player2.Name}"); Console.ReadLine(); int player2Number; do { Console.WriteLine($"Try to guess the number. This number located between {Min} and {Max}. It's your {++attemp}/{attempCount} attemp"); player2Number = ReadInteger.FromConsole(validatorMinMax); if (player2Number > player1Number) { Console.WriteLine($"{player2Number} is biger than conceived"); } if (player2Number < player1Number) { Console.WriteLine($"{player2Number} is less than conceived"); } if (player1Number == player2Number) { win = true; } } while ((player1Number != player2Number) && (attemp < attempCount)); }
public void NumberShouldBeBiggerMinAndLessMax_False(int number, int min, int max) { //var var validatorMinMax = new ValidatorMinMax(min, max); //act var actualResult = validatorMinMax.Validate(number); //assert Assert.IsFalse(actualResult); }
private void FirstPlayerStep() { Console.WriteLine($"{Player1.Name} Enter the Min board"); Min = ReadInteger.FromConsole(); var validatorMin = new ValidatorMin(Min); Console.WriteLine($"{Player1.Name} Enter the Max board"); Max = ReadInteger.FromConsole(validatorMin); var validatorMinMax = new ValidatorMinMax(Min, Max); Console.WriteLine($"{Player1.Name} Enter the Number"); player1Number = ReadInteger.FromConsole(validatorMinMax); attempCount = AttempCalculator(Min, Max); }