예제 #1
0
        public void AskManyQuestions()
        {
            var categoryQuestions = new CategoryQuestions("anything");

            categoryQuestions.AddQuestion("first");
            categoryQuestions.AddQuestion("second");
            Assert.Equal("first", categoryQuestions.NextQuestion());
            Assert.Equal("second", categoryQuestions.NextQuestion());
        }
예제 #2
0
        public void AskTooManyQuestions()
        {
            var categoryQuestions = new CategoryQuestions("anything");

            categoryQuestions.AddQuestion("first");
            categoryQuestions.NextQuestion();

            var ex = Record.Exception(() => categoryQuestions.NextQuestion());

            Assert.IsType <InvalidOperationException>(ex);
            Assert.Contains("out of questions", ex.Message, StringComparison.InvariantCultureIgnoreCase);
        }