public void GetQuestions_ShouldReturnCorrectCollection() { //Arrange TriviaQuestion question = new TriviaQuestion(); TriviaQuestion_Repo repo = new TriviaQuestion_Repo(); repo.AddQuestionToList(question); //Act List <TriviaQuestion> questions = repo.GetQuestions(); bool directoryHasQuestions = questions.Contains(question); //Assert Assert.IsTrue(directoryHasQuestions); }
public void PrintTheWholeRepo() { List <TriviaQuestion> listOfQuestions = _repo.GetQuestions(); foreach (TriviaQuestion question in listOfQuestions) { Console.WriteLine("QuestionID: " + question.QuestionID); Console.WriteLine("Question: " + question.Question); Console.WriteLine("Right Answer: " + question.CorrectAnswer); Console.WriteLine("Wrong 1: " + question.WrongAnswer1); Console.WriteLine("Wrong 2: " + question.WrongAnswer2); Console.WriteLine("Wrong 3: " + question.WrongAnswer3); Console.WriteLine("Category: " + question.TriviaCategory); } Console.WriteLine("Press any key to exit"); Console.ReadKey(); }