Пример #1
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();
            Assert.Throws <KeyNotFoundException>(() => catalog[new FeedUri("http://invalid/")]);
        }
Пример #2
0
 /// <summary>
 /// Creates a fictive test <see cref="Catalog"/>.
 /// </summary>
 public static Catalog CreateTestCatalog() => new Catalog
 {
     Feeds = { FeedTest.CreateTestFeed() }
 };