Example #1
0
        public void Initialize()
        {
            _factory     = new IsolatedStorageFeedFactory();
            _rssDocument = _factory.CreateFeed(new Uri(SilverlightTestFileLoader.SampleRssFeeds().First(), UriKind.Relative), FeedType.Rss20,
                                               SilverlightTestFileLoader.ReadFeedContents(SilverlightTestFileLoader.SampleRssFeeds().First()));

            _atomDocument = _factory.CreateFeed(new Uri(SilverlightTestFileLoader.SampleAtomFeeds().First(), UriKind.Relative), FeedType.Atom10,
                                                SilverlightTestFileLoader.ReadFeedContents(SilverlightTestFileLoader.SampleAtomFeeds().First()));
        }
 public void Initialize()
 {
     _factory     = new IsolatedStorageFeedFactory();
     _rssDocument =
         SilverlightTestFileLoader.ReadFeedContents(SilverlightTestFileLoader.SampleRssFeeds().First());
     _atomDocument =
         SilverlightTestFileLoader.ReadFeedContents(SilverlightTestFileLoader.SampleAtomFeeds().First());
     SilverlightTestFileLoader.WriteFeedToIsolatedStorage(_rssDocument, new Uri(SimpleRssPath, UriKind.Relative));
     SilverlightTestFileLoader.WriteFeedToIsolatedStorage(_rssDocument, new Uri(ComplexRssPath, UriKind.Relative));
     SilverlightTestFileLoader.WriteFeedToIsolatedStorage(_atomDocument, new Uri(SimpleAtomPath, UriKind.Relative));
     SilverlightTestFileLoader.WriteFeedToIsolatedStorage(_atomDocument, new Uri(ComplexAtomPath, UriKind.Relative));
 }
Example #3
0
        public void CanWriteFeedsToIsolatedStorageWithSimplePath()
        {
            var items    = SilverlightTestFileLoader.SampleRssFeeds();
            var feedXml  = SilverlightTestFileLoader.ReadFeedContents(items[0]);
            var feedPath = new Uri(SimpleFileUri, UriKind.Relative);

            SilverlightTestFileLoader.WriteFeedToIsolatedStorage(feedXml, feedPath);

            using (var store = IsolatedStorageFile.GetUserStoreForApplication())
            {
                Assert.IsTrue(store.FileExists(feedPath.OriginalString));
            }
        }
Example #4
0
        public void CanLoadRssTestFiles()
        {
            try
            {
                var            items       = SilverlightTestFileLoader.SampleRssFeeds();
                IList <string> parsedItems = items.Select(SilverlightTestFileLoader.ReadFeedContents).ToList();

                Assert.IsTrue(parsedItems.Count > 0);
                Assert.IsTrue(parsedItems[0].Length > 0);
            }
            catch (Exception ex)
            {
                var debugEx = ex;
                Assert.Fail(string.Format("Caught error {0}", ex.Message));
            }
        }
Example #5
0
        public void CanWriteFeedsToIsolatedStorageWithComplexPath()
        {
            try
            {
                var items    = SilverlightTestFileLoader.SampleRssFeeds();
                var feedXml  = SilverlightTestFileLoader.ReadFeedContents(items[0]);
                var feedPath = new Uri(ComplexFileUri, UriKind.Relative);

                SilverlightTestFileLoader.WriteFeedToIsolatedStorage(feedXml, feedPath);

                using (var store = IsolatedStorageFile.GetUserStoreForApplication())
                {
                    Assert.IsTrue(store.FileExists(feedPath.OriginalString));
                }
            }
            catch (Exception ex)
            {
                var debugEx = ex;
                Assert.Fail(string.Format("Caught error {0}", ex.Message));
            }
        }
Example #6
0
        public void CanFindRssTestFiles()
        {
            var items = SilverlightTestFileLoader.SampleRssFeeds();

            Assert.IsTrue(items.Count > 0);
        }