public void ShowAnswerCheck(string currentAnswer, IAnswerCheckDto answerCheck)
        {
            var white = new string('x', answerCheck.WhitePoints);
            var black = new string('o', answerCheck.BlackPoints);

            Console.WriteLine(string.Format($"#{_gameService.RoundsPlayed}\t{currentAnswer}\t{white}{black}"));
        }
        public void InitialCheckState_ShouldReturnEmptyNotCorrect()
        {
            // Arrange

            // Act
            IAnswerCheckDto result = _serviceUnderTest.LastCheck;

            // Assert
            Assert.AreEqual(false, result.IsCorrect);
            Assert.AreEqual(0, result.BlackPoints);
            Assert.AreEqual(0, result.WhitePoints);
        }
 public void ShowGameScore(IAnswerCheckDto answerCheck)
 {
     if (answerCheck.WhitePoints == _gameService.Settings.Digits)
     {
         Console.Write($"Congratulation, you win");
     }
     else
     {
         Console.Write($"Game over, passcode not found");
     }
     Console.WriteLine(string.Format($" after {_gameService.RoundsPlayed} rounds"));
 }
Ejemplo n.º 4
0
 public bool IsCheckResultDifferent(IAnswerCheckDto check1, IAnswerCheckDto check2)
 {
     return(check1.WhitePoints == check2.WhitePoints && check1.BlackPoints == check2.BlackPoints);
 }
Ejemplo n.º 5
0
        public bool IsKeyToBeRemoved(string key, string usedKey, IAnswerCheckDto check)
        {
            var commonCheck = CheckAnswer(key, usedKey);

            return(!IsCheckResultDifferent(check, commonCheck));
        }