示例#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));
 }
示例#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));
            }
        }
示例#4
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));
            }
        }