Beispiel #1
1
        public void CanAddNewSubscription()
        {
            var httpClient = new StubHttpClient()
            {
                ExpectedUrl = endpointUrls.AddSubscription,
                ExpectedResponse = "",
            };

            var reader = new ReaderAccount(httpClient, endpointUrls);
            reader.AddSubscription("http://feeds.feedburner.com/ajaxian");
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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();
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        public MainWindow(ReaderAccount readerAccount)
        {
            this.readerAccount = readerAccount;

            InitializeComponent();
        }
Beispiel #6
0
 public Subscription(ReaderAccount googleReader)
 {
     this.googleReader = googleReader;
 }