Beispiel #1
0
        public void IncludeATitleMenuItemIfDisplayTitleInNavbarIsTrue()
        {
            string title        = string.Empty.GetRandom();
            var    siteSettings = new SiteSettingsBuilder()
                                  .DisplayTitleInNavbar(true)
                                  .Title(title)
                                  .Build();

            var contentRepo = new Mock <IContentRepository>();

            contentRepo.Setup(r => r.GetSiteSettings()).Returns(siteSettings);

            IServiceProvider serviceProvider = (new ServiceCollection())
                                               .AddContentRepository(contentRepo)
                                               .AddLinkProvider()
                                               .BuildServiceProvider();

            var target = (null as BootstrapProvider).Create(serviceProvider);

            var    pages = (null as IEnumerable <ContentItem>).Create();
            String outputFileExtension = "html";
            String pathToRoot          = string.Empty;

            var actual = target.CreateNavigation(pages, pathToRoot, outputFileExtension);

            Assert.Contains(title, actual.ToLower());
        }
Beispiel #2
0
        public void ReturnTheProperValueForTheme()
        {
            String expected = string.Empty.GetRandom();
            Func <SiteSettings, string> fieldValueDelegate = s => s.Theme;
            var siteSettings = new SiteSettingsBuilder()
                               .Theme(expected)
                               .Build();

            ExecutePropertyTest(siteSettings, expected, fieldValueDelegate);
        }
Beispiel #3
0
        public void ReturnTheDefaultValueIfPostsPerFeedIsNotSupplied()
        {
            Int32  expectedValue = _defaultPostsPerFeed;
            String expected      = expectedValue.ToString();
            Func <SiteSettings, string> fieldValueDelegate = s => s.PostsPerFeed.ToString();
            var siteSettings = new SiteSettingsBuilder()
                               .PostsPerFeed(0)
                               .Build();

            ExecutePropertyTest(siteSettings, expected, fieldValueDelegate);
        }
Beispiel #4
0
        public void ReturnTheProperValueForPostsPerFeed()
        {
            Int32  expectedValue = 25.GetRandom(5);
            String expected      = expectedValue.ToString();
            Func <SiteSettings, string> fieldValueDelegate = s => s.PostsPerFeed.ToString();
            var siteSettings = new SiteSettingsBuilder()
                               .PostsPerFeed(expectedValue)
                               .Build();

            ExecutePropertyTest(siteSettings, expected, fieldValueDelegate);
        }