Exemplo n.º 1
0
        public void FailToStartNewGameWithoutCategories()
        {
            var questionsRepository = new FakeQuestionsRepository();

            Check.ThatCode(() => Game.StartNew(questionsRepository, "test", new string[] { }))
            .Throws <Exception>();
        }
Exemplo n.º 2
0
        public void StartNewGame()
        {
            var questionsRepository = new FakeQuestionsRepository();

            var gameStarted = Game.StartNew(questionsRepository, "test", new [] { "Sports", "Science" });

            Check.That(gameStarted.Name).IsEqualTo("test");
            Check.That(gameStarted.GameCategories.Select(x => (x.Name, x.Questions.Count)))
            .ContainsExactly(("Sports", 50), ("Science", 50));
        }