public void FindQuestionsByTag_allTagsQuestionsReturned() { var jsonString = File.ReadAllText("questions.json"); var data = JsonConvert.DeserializeObject <Rootobject>(jsonString); var analyzer = new QuestionsAnalyzer(data); var result = analyzer.FindQuestionsByTag("c#"); Assert.AreEqual("Why are COM event handlers always null?", result.Single()); }
public void Start() { var featuredQuestions = Client.GetFeaturedQuestions(); Debugger.Break(); var analyzer = new QuestionsAnalyzer(featuredQuestions); var mostUsedTag = analyzer.GetMostUsedTag(); MessageBox.Show("The most used tag is: " + mostUsedTag); if (analyzer.HasQuestionsWithTag("c#")) { var questionList = analyzer.FindQuestionsByTag("c#"); MessageBox.Show("Selected questions: " + string.Join("\n", questionList.ToArray())); } }