Пример #1
0
        public void ShouldNotAddBackgroundImageOrSectionsOrBreadcrumbsOrAlertsOrProfilesOrParentTopicOrDocumentsOrLiveChatIfTheyAreLinks()
        {
            _contentfulArticle.BackgroundImage.SystemProperties.Type = "Link";
            _contentfulArticle.Sections.First().Sys.Type = "Link";
            _contentfulArticle.Breadcrumbs.First().Sys.Type = "Link";
            _contentfulArticle.Alerts.First().Sys.Type = "Link";
            _contentfulArticle.Profiles.First().Sys.Type = "Link";
            _contentfulArticle.Documents.First().SystemProperties.Type = "Link";

            var article = _articleFactory.ToModel(_contentfulArticle);

            article.BackgroundImage.Should().BeEmpty();

            article.Sections.Count.Should().Be(0);
            _sectionFactory.Verify(o => o.ToModel(It.IsAny <ContentfulSection>()), Times.Never);

            article.Breadcrumbs.Count().Should().Be(0);
            _crumbFactory.Verify(o => o.ToModel(It.IsAny <ContentfulReference>()), Times.Never);

            article.Alerts.Count().Should().Be(0);
            _crumbFactory.Verify(o => o.ToModel(It.IsAny <ContentfulReference>()), Times.Never);

            article.Profiles.Count().Should().Be(0);
            _crumbFactory.Verify(o => o.ToModel(It.IsAny <ContentfulReference>()), Times.Never);

            article.ParentTopic.Should().BeEquivalentTo(new NullTopic());

            article.Documents.Count.Should().Be(0);
            _crumbFactory.Verify(o => o.ToModel(It.IsAny <ContentfulReference>()), Times.Never);
        }