private void btnCheckForUpdatesCustom_Click(object sender, EventArgs e) { string feedUrl = InputBox("Please enter a Url for a valid NauXml feed", "Feed Url required", ""); if (string.IsNullOrEmpty(feedUrl)) { return; } IUpdateSource source = UpdateManager.Instance.UpdateSource; if (source is SimpleWebSource) { // All we need to do is set the feed url and we are all set, no need to create new objects etc ((SimpleWebSource)source).FeedUrl = feedUrl; CheckForUpdates(source); } else { // No idea what we had there, so we create a new feed source and pass it along - note the // source for retreiving the actual updates will keep intact, and will be used when preparing // the updates source = new SimpleWebSource(feedUrl); CheckForUpdates(source); } }
public void can_download_ansi_feed() { const string expected = "NHibernate.Profiler-Build-"; var ws = new SimpleWebSource("http://builds.hibernatingrhinos.com/latest/nhprof"); var str = ws.GetUpdatesFeed(); Assert.AreEqual(expected, str.Substring(0, expected.Length)); }
public void can_download_ansi_feed() { const string expected = "<!doctype html>"; var ws = new SimpleWebSource("http://builds.hibernatingrhinos.com/latest/nhprof"); var str = ws.GetUpdatesFeed(); Assert.IsNotNull(str); str = str.Trim(); Assert.IsTrue(str.StartsWith(expected, StringComparison.InvariantCultureIgnoreCase)); }