CreateTestFeed() public static method

Creates a fictive test Feed.
public static CreateTestFeed ( ) : Feed
return Feed
Example #1
0
        public void TestGetFeed()
        {
            var catalog = CreateTestCatalog();

            Assert.AreEqual(FeedTest.CreateTestFeed(), catalog.GetFeed(FeedTest.Test1Uri));
            Assert.AreEqual(FeedTest.CreateTestFeed(), catalog[FeedTest.Test1Uri]);

            Assert.IsNull(catalog.GetFeed(new FeedUri("http://invalid/")));
            // ReSharper disable once UnusedVariable
            Assert.Throws <KeyNotFoundException>(() => { var dummy = catalog[new FeedUri("http://invalid/")]; });
        }
Example #2
0
        public void TestGetFeed()
        {
            var catalog = CreateTestCatalog();

            catalog.GetFeed(FeedTest.Test1Uri).Should().Be(FeedTest.CreateTestFeed());
            catalog[FeedTest.Test1Uri].Should().Be(FeedTest.CreateTestFeed());

            catalog.GetFeed(new FeedUri("http://invalid/")).Should().BeNull();
            // ReSharper disable once UnusedVariable
            catalog.Invoking(x => { var _ = x[new FeedUri("http://invalid/")]; }).ShouldThrow <KeyNotFoundException>();
        }
Example #3
0
 /// <summary>
 /// Creates a fictive test <see cref="Catalog"/>.
 /// </summary>
 public static Catalog CreateTestCatalog()
 {
     return(new Catalog {
         Feeds = { FeedTest.CreateTestFeed() }
     });
 }