예제 #1
0
        public override ITypingRaceInstance CreateTypingRaceInstace()
        {
            var randomSentence = _sentenceLoader.GetNextRandomSentence();

            var classicRace = new ClassicTypingRaceInstance(
                title: "Classic Game",
                sentence: randomSentence.Words,
                duration: _timeService.CalculateGameDuration(randomSentence),
                timeService: _timeService,
                typingCalculator: _typingCalculator,
                commandInvoker: _commandInvoker,
                gameRenderer: new GameRenderer());

            classicRace.Subscribe(_gameRenderer);

            return(classicRace);
        }
예제 #2
0
        public void CalculateGameDurationReturnsCorrectResultWhenInputIsValid([ValueSource("validDataSet")] TestData testData)
        {
            var result = _timeService.CalculateGameDuration(testData.Sentence);

            result.ShouldBe(testData.ExpectedResult);
        }