public void SetUp() { IQuiz <bool, bool> quiz = Substitute.For <Quiz <bool, bool> >(); testObject = quiz; testObject.IsCorrect(true).Returns(true); testObject.IsCorrect(false).Returns(false); }
public void Answer_Quiz_Return_Active_Quiz_IsCorrect(bool answer) { IQuiz newQuiz = Substitute.For <IQuiz>(); newQuiz.IsCorrect(true).Returns(true); newQuiz.IsCorrect(false).Returns(false); testObject.AddQuiz(newQuiz); testObject.SelectQuiz(newQuiz); Assert.That(testObject.AnswerQuiz(true), Is.EqualTo(true)); }
private void PopulateSystem(int times) { for (int i = 0; i < times; i++) { IQuiz newQuiz = Substitute.For <IQuiz>(); newQuiz.IsCorrect(true).Returns(true); newQuiz.IsCorrect(false).Returns(false); testObject.AddQuiz(newQuiz); } }
public void Is_Correct_Return_True_On_Correct_Answer() { Assert.That(testObject.IsCorrect(true), Is.True); }