/ Published in: C#
A test I wrote for a component that imports RSS feeds and saves each item as a page in EPiServer CMS. While writing this test and some others I tried to build a DSL for the test project.
Expand |
Embed | Plain Text
[Fact] public void NoNewItemExists_NoNewPageIsSaved() { var root = GivenA.SyndicationFeedRoot; .ThatForSyndicationFeedRootsReturns(root); SyndicationItem item = FixtureHelper.CreateSyndicationItem(); .ThatForUrl(root.FeedUrl) .ReturnsFeedWith(item); existingPage.ItemPublishedDate = item.PublishDate.DateTime.ToLocalTime(); .ThatForPageReference(root.PageLink) .ReturnsSingleChild(existingPage) .And .ThatForGetDefaultPageDataCalledWith<SyndicationItemPage>(root.PageLink) feedFetcher, pageRepository); importer.ImportFeeds(); Assert.False(pageRepository.HasSavedAny<SyndicationItemPage>()); }
You need to login to post a comment.
