Exemplo n.º 1
0
 public MockMagpieUpdater(string validUrl, IDebuggingInfoLogger infoLogger = null) : base(new AppInfo(validUrl), infoLogger)
 {
     var validJson = VALID_JSON.Replace("'", "\"");
     _remoteContentDownloader = Substitute.For<IRemoteContentDownloader>();
     _remoteContentDownloader.DownloadStringContent(validUrl).Returns(Task.FromResult(validJson));
     base.RemoteContentDownloader = _remoteContentDownloader;
 }
Exemplo n.º 2
0
 public MockMagpie(string validUrl, IDebuggingInfoLogger infoLogger = null, IAnalyticsLogger analyticsLogger = null)
     : base(new AppInfo(validUrl), infoLogger, analyticsLogger)
 {
     _remoteContentDownloader = Substitute.For <IRemoteContentDownloader>();
     _remoteContentDownloader.DownloadStringContent(validUrl, Arg.Any <IDebuggingInfoLogger>()).Returns(Task.FromResult(VALID_JSON));
     RemoteContentDownloader = _remoteContentDownloader;
 }
Exemplo n.º 3
0
        public MockMagpieUpdater(string validUrl, IDebuggingInfoLogger infoLogger = null) : base(new AppInfo(validUrl), infoLogger)
        {
            var validJson = VALID_JSON.Replace("'", "\"");

            _remoteContentDownloader = Substitute.For <IRemoteContentDownloader>();
            _remoteContentDownloader.DownloadStringContent(validUrl).Returns(Task.FromResult(validJson));
            base.RemoteContentDownloader = _remoteContentDownloader;
        }
Exemplo n.º 4
0
        private async Task <string> FetchReleaseNotesAsync(string releaseNotesUrl)
        {
            _logger.Log("Fetching release notes");
            var notes = await _contentDownloader.DownloadStringContent(releaseNotesUrl).ConfigureAwait(false);

            _logger.Log("Finished fetching release notes");
            _logger.Log("Converting release notes from markdown to html");
            var htmlNotes = CommonMark.CommonMarkConverter.Convert(notes);

            htmlNotes = CreateDefaultCssLink() + htmlNotes;
            _logger.Log("Finished converting release notes from markdown to html");
            return(htmlNotes);
        }
Exemplo n.º 5
0
        private async Task <string> FetchReleaseNotesAsync(string releaseNotesUrl)
        {
            _logger.Log("Fetching release notes");
            var notes = await _contentDownloader.DownloadStringContent(releaseNotesUrl).ConfigureAwait(false);

            _logger.Log("Finished fetching release notes");
            _logger.Log("Converting release notes from markdown to html");
            var pipeline  = new MarkdownPipelineBuilder().UseTaskLists().UseAutoLinks().UseEmojiAndSmiley().UseGenericAttributes().Build();
            var htmlNotes = Markdown.ToHtml(notes, pipeline);

            htmlNotes = CreateDefaultCssLink() + htmlNotes;
            _logger.Log("Finished converting release notes from markdown to html");
            htmlNotes = "<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'>" + htmlNotes;
            return(htmlNotes);
        }