コード例 #1
0
ファイル: MainMenu.cs プロジェクト: hit-subscribe/ElDorado
        public static void RecordMetrics()
        {
            var webClient        = new SimpleWebClient();
            var feedlyInquisitor = new FeedlyInquisitor(webClient);
            var alexaInquisitor  = new AlexaDataInquisitor(webClient);
            var mozInquisitor    = new MozInquisitor(new CredentialStore(File.ReadAllText(@"CredFiles\moz.cred")), webClient)
            {
                Timeout = 10
            };

            var metricsRecorder = new BlogMetricsRecorder(feedlyInquisitor, alexaInquisitor, mozInquisitor);

            using (var context = new BlogContext())
            {
                var blogs       = context.Blogs.ToList();
                var blogMetrics = metricsRecorder.GenerateMetrics(blogs);
                context.BlogMetrics.AddRange(blogMetrics);
                context.SaveChanges();
            }
        }
コード例 #2
0
 public void BeforeEachTest()
 {
     Target = new BlogMetricsRecorder(FeedlyInquisitor, AlexaInquisitor, MozInquisitor);
 }