public void ChooseQuestionsForTest() { while (QuestionsRandomlyChoosenForTest.Count < NumberOfQuestionsForThisTest) { Random r = new Random(); int _question = r.Next(QuestionsInSet.Count); if (!QuestionsRandomlyChoosenForTest.Contains(QuestionsInSet[_question])) { QuestionsRandomlyChoosenForTest.Add(QuestionsInSet[_question]); } } }