Esempio n. 1
0
 public void Execute()
 {
     if (_typingRaceInstance.UserInput.Length < _typingRaceInstance.Sentence.Length)
     {
         _typingRaceInstance.AddNewLetter(_letter);
     }
 }
        public void GameIsFinishedReturnsTrueWhenUserInputAndSentenceAreEqual(string sentence, char letter)
        {
            _raceInstance = new ClassicTypingRaceInstance(
                title: gameTitle,
                sentence: sentence,
                duration: gameDuration,
                timeService: _timeService,
                typingCalculator: _typingCalculator,
                commandInvoker: _commandInvoker,
                gameRenderer: _gameRenderer);

            _raceInstance.AddNewLetter(letter);
            _raceInstance.AddNewLetter(letter);
            _raceInstance.AddNewLetter(letter);

            _raceInstance.GameIsFinished().ShouldBeTrue();
        }
 public void AddNewLetterConcatinatesNewLetterToAnExistingUserInput(char letter)
 {
     _raceInstance.AddNewLetter(letter);
     _raceInstance.UserInput.ShouldBe("!");
 }