public void ShouldContainErrorViewModelWhenThereIsntAnyBuilderForAlias() { var contentWithoutBuilder = new PublishedContentMockingHelper(); contentWithoutBuilder.SetAlias("Alias without builder"); _mocekdContents.Add(contentWithoutBuilder.ContentMock); var sections = _sectionProvider.GetListOfSectionsToRender(_mocekdContents); Assert.IsTrue(sections.Any(x => x.ViewModel is SectionErrorViewModel)); }
public void SetUp() { _buildersList = new List <ISectionBuilder> { new HeaderBuilder(new NodeHelper()), new FooterBuilder(null) }; var builderFactory = new BuildersFactory(_buildersList); _sectionProvider = new SectionsProvider(builderFactory); var mockContentHeader = new PublishedContentMockingHelper(); mockContentHeader.SetAlias(SectionDocumentTypes.Header); var mockContentFooter = new PublishedContentMockingHelper(); mockContentFooter.SetAlias(SectionDocumentTypes.Footer); _mocekdContents = new List <IPublishedContent> { mockContentHeader.ContentMock, mockContentFooter.ContentMock }; }