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/")]); }
/// <summary> /// Creates a fictive test <see cref="Catalog"/>. /// </summary> public static Catalog CreateTestCatalog() => new Catalog { Feeds = { FeedTest.CreateTestFeed() } };