Example #1
0
        public void SeoMetaRobotsIndex_WithArgument_ReturnsHtmlContainingValue(
            RobotsIndex robotsIndex,
            string expectedContent)
        {
            // Arrange
            var htmlHelper = HtmlHelperTestFactory.Create();

            // Act
            var html = htmlHelper.SeoMetaRobotsIndex(robotsIndex);

            // Assert
            bool htmlContainsRobots          = html.Contains("robots");
            var  metaContent                 = RobotsIndexManager.GetMetaContent(robotsIndex);
            bool htmlContainsMetaContent     = html.Contains(metaContent);
            bool htmlContainsExpectedContent = html.Contains(expectedContent);

            Assert.True(htmlContainsRobots);
            Assert.True(htmlContainsMetaContent);
            Assert.True(htmlContainsExpectedContent);
        }
Example #2
0
        public void SeoMetaRobotsIndex_EmptyArgumentWithMetaRobotsNoIndexInSeoHelper_ReturnsHtmlContainingValue()
        {
            // Arrange
            var viewContext = ViewContextTestFactory.Create();
            var htmlHelper  = HtmlHelperTestFactory.Create(viewContext);
            var seoHelper   = SeoHelperTestFactory.Create(viewContext);

            seoHelper.MetaRobotsNoIndex = true;

            // Act
            var html = htmlHelper.SeoMetaRobotsIndex();

            // Assert
            bool htmlContainsRobots      = html.Contains("robots");
            var  defaultRobotsNoIndex    = RobotsIndexManager.GetMetaContent(RobotsIndexManager.DefaultRobotsNoIndex);
            bool htmlContainsMetaContent = html.Contains(defaultRobotsNoIndex);

            Assert.True(htmlContainsRobots);
            Assert.True(htmlContainsMetaContent);
        }
Example #3
0
        public void SeoMetaRobotsIndex_EmptyArgumentWithValuesInSeoHelper_ReturnsHtmlContainingValue(
            RobotsIndex robotsIndex,
            string expectedContent)
        {
            // Arrange
            var viewContext = ViewContextTestFactory.Create();
            var htmlHelper  = HtmlHelperTestFactory.Create(viewContext);
            var seoHelper   = SeoHelperTestFactory.Create(viewContext);

            seoHelper.MetaRobotsIndex = robotsIndex;

            // Act
            var html = htmlHelper.SeoMetaRobotsIndex();

            // Assert
            bool htmlContainsRobots          = html.Contains("robots");
            var  metaContent                 = RobotsIndexManager.GetMetaContent(robotsIndex);
            bool htmlContainsMetaContent     = html.Contains(metaContent);
            bool htmlContainsExpectedContent = html.Contains(expectedContent);

            Assert.True(htmlContainsRobots);
            Assert.True(htmlContainsMetaContent);
            Assert.True(htmlContainsExpectedContent);
        }