public QuestionDeck() { var pop = new CategoryQuestions("Pop"); pop.PlacedOn(new[] { 0, 4, 8 }); var science = new CategoryQuestions("Science"); science.PlacedOn(new[] { 1, 5, 9 }); var sports = new CategoryQuestions("Sports"); sports.PlacedOn(new[] { 2, 6, 10 }); var rock = new CategoryQuestions("Rock"); rock.PlacedOn(new[] { 3, 7, 11 }); categories = new List <CategoryQuestions> { pop, science, sports, rock }; }
public void NotPlacedOnAskedPosition() { var categoryQuestions = new CategoryQuestions("anything"); categoryQuestions.PlacedOn(new[] { 5, 9 }); Assert.False(categoryQuestions.IsPlacedOn(6)); }
public void PlacedOnAskedPosition() { var categoryQuestions = new CategoryQuestions("anything"); categoryQuestions.PlacedOn(new[] { 5, 9 }); Assert.True(categoryQuestions.IsPlacedOn(5)); Assert.True(categoryQuestions.IsPlacedOn(9)); }
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); }
public void ExposeName() { var categoryQuestions = new CategoryQuestions("my name"); Assert.Equal("my name", categoryQuestions.Name); }