public void AskManyQuestions() { var categoryQuestions = new CategoryQuestions("anything"); categoryQuestions.AddQuestion("first"); categoryQuestions.AddQuestion("second"); Assert.Equal("first", categoryQuestions.NextQuestion()); Assert.Equal("second", categoryQuestions.NextQuestion()); }
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); }