public void TestAnalysis()
        {
            string jsonString;

            using (var stream = File.OpenText("./Json.txt"))
            {
                jsonString = stream.ReadToEnd();
            }
            var analyser = new AnswerAnalyser(jsonString);
            var obj      = analyser.Analyse();

            Assert.IsNotNull(obj);
        }
示例#2
0
        public static IEnumerable <FetcherViewModel> GetResults(string jsonString)
        {
            var analyser = new AnswerAnalyser(jsonString);
            var results  = analyser.Analyse();

            var rt = new List <FetcherViewModel>(results.Count);

            foreach (var item in results)
            {
                rt.Add(new FetcherViewModel()
                {
                    Id = item.Question.Id, Title = item.Question.Title, Answers = item.Answer.Result
                });
            }
            return(rt);
        }