public SectionContentfulFactoryTest() { _contentfulSection = new ContentfulSectionBuilder().Build(); _profileFactory = new Mock <IContentfulFactory <ContentfulProfile, Profile> >(); _documentFactory = new Mock <IContentfulFactory <Asset, Document> >(); _videoRepository = new Mock <IVideoRepository>(); _timeProvider = new Mock <ITimeProvider>(); _alertFactory = new Mock <IContentfulFactory <ContentfulAlert, Alert> >(); _timeProvider.Setup(o => o.Now()).Returns(new DateTime(2017, 01, 01)); _sectionFactory = new SectionContentfulFactory(_profileFactory.Object, _documentFactory.Object, _videoRepository.Object, _timeProvider.Object, _alertFactory.Object); }
public void ShouldSetDefaultsOnModel() { var actual = new ContentfulSection(); var expected = new ContentfulSection { Title = string.Empty, Slug = string.Empty, Body = string.Empty, Profiles = new List <ContentfulProfile>(), Documents = new List <Asset>(), SunriseDate = DateTime.MinValue.ToUniversalTime(), SunsetDate = DateTime.MaxValue.ToUniversalTime() }; actual.Should().BeEquivalentTo(expected); }
public ContentfulArticleBuilder Section(ContentfulSection section) { _sections.Add(section); return(this); }