Exemple #1
0
        public void ContainSessionDetails()
        {
            var gameSession = new ReindeerGameSession(GetTestSession(), Substitute.For <ILogger>());

            gameSession.CurrentQuestion.Should().BeSameAs(SampleQuestion);
            gameSession.Score.Should().Be(3);
            gameSession.QuestionIndices.ShouldAllBeEquivalentTo(QuestionIndices);
        }
Exemple #2
0
        public void ReturnValidSessionDictionary()
        {
            var gameSession = new ReindeerGameSession(GetTestSession(), Substitute.For <ILogger>());
            var dictionary  = gameSession.CreateSessionDictionary();

            dictionary["Score"].Should().Be(3);
            ((int[])dictionary["QuestionIndices"]).ShouldAllBeEquivalentTo(QuestionIndices);
            dictionary["CurrentQuestion"].Should().BeSameAs(SampleQuestion);
        }
Exemple #3
0
        public void FlagIfGameIsInProgress()
        {
            // Game in progress
            var gameSession = new ReindeerGameSession(GetTestSession(), Substitute.For <ILogger>());

            gameSession.IsGameInProgress().Should().BeTrue();

            // No game in progress
            var noGameSession = new ReindeerGameSession(Substitute.For <ISession>(), Substitute.For <ILogger>());

            noGameSession.IsGameInProgress().Should().BeFalse();
        }