public void CanAddNewSubscription() { var httpClient = new StubHttpClient() { ExpectedUrl = endpointUrls.AddSubscription, ExpectedResponse = "", }; var reader = new ReaderAccount(httpClient, endpointUrls); reader.AddSubscription("http://feeds.feedburner.com/ajaxian"); }
public void CanParseAtomBasedSubscriptionItems() { var httpClient = new StubHttpClient() { ExpectedUrl = endpointUrls.SubscriptionItems + "feed%2Fid", // feed ID must be URL-encoded ExpectedResponse = @"{ ""items"": [ { ""title"": ""Ajaxian » Front Page"", ""content"": { ""content"": ""Dummy Content"" } } ] }", }; var reader = new ReaderAccount(httpClient, endpointUrls); var subscription = new Subscription(null) { Id = "feed/id", }; Assert.AreEqual("Ajaxian » Front Page", reader.ItemsForSubscription(subscription).ElementAt(0).Title); Assert.AreEqual("Dummy Content", reader.ItemsForSubscription(subscription).ElementAt(0).Content); }
private void StartupMainWindow(object sender, EventArgs e) { var account = new ReaderAccount(login.Email, login.Password); var main = new MainWindow(account); Application.Current.MainWindow = main; main.OpenAccount(); }
public void CanFetchSubscriptionList() { var httpClient = new StubHttpClient() { ExpectedUrl = endpointUrls.SubscriptionList, ExpectedResponse = @"{ ""subscriptions"": [ { ""id"": ""feed/http://feeds.feedburner.com/ajaxian"", ""title"": ""Ajaxian » Front Page"" } ] }", }; var reader = new ReaderAccount(httpClient, endpointUrls); Assert.AreEqual("feed/http://feeds.feedburner.com/ajaxian", reader.Subscriptions.ElementAt(0).Id); Assert.AreEqual("Ajaxian » Front Page", reader.Subscriptions.ElementAt(0).Title); }
public MainWindow(ReaderAccount readerAccount) { this.readerAccount = readerAccount; InitializeComponent(); }
public Subscription(ReaderAccount googleReader) { this.googleReader = googleReader; }