public void SeoMetaRobotsIndex_EmptyArgument_ReturnsNull() { // Arrange var htmlHelper = HtmlHelperTestFactory.Create(); // Act var html = htmlHelper.SeoMetaRobotsIndex(); // Assert Assert.Null(html); }
public void SeoMetaDescription_EmptyArgument_ReturnsNull() { // Arrange var htmlHelper = HtmlHelperTestFactory.Create(); // Act var html = htmlHelper.SeoMetaDescription(); // Assert Assert.Null(html); }
public void SeoMetaKeywords_WithArgument_ReturnsHtmlContainingValue() { // Arrange var htmlHelper = HtmlHelperTestFactory.Create(); // Act var html = htmlHelper.SeoMetaKeywords(TestData.TestMetaKeywords); // Assert bool htmlContainsValue = html.Contains(TestData.TestMetaKeywords); Assert.True(htmlContainsValue); }
public void SeoLinkCanonical_EmptyArgumentWithValueInSeoHelper_ReturnsHtmlContainingValue() { // Arrange var viewContext = ViewContextTestFactory.Create(); var htmlHelper = HtmlHelperTestFactory.Create(viewContext); var seoHelper = SeoHelperTestFactory.Create(viewContext); seoHelper.LinkCanonical = $"{TestData.TestLinkCanonical}"; // Act var html = htmlHelper.SeoLinkCanonical(); // Assert bool htmlContainsValue = html.Contains(TestData.TestLinkCanonical); Assert.True(htmlContainsValue); }
public void SeoMetaKeywords_EmptyArgumentWithValueInSeoHelper_ReturnsHtmlContainingValue() { // Arrange var viewContext = ViewContextTestFactory.Create(); var htmlHelper = HtmlHelperTestFactory.Create(viewContext); var seoHelper = SeoHelperTestFactory.Create(viewContext); seoHelper.MetaKeywords = TestData.TestMetaKeywords; // Act var html = htmlHelper.SeoMetaKeywords(); // Assert bool htmlContainsValue = html.Contains(TestData.TestMetaKeywords); Assert.True(htmlContainsValue); }
SeoLinkCanonical_WithAppRelativeLinkCanonicalAndLinkCanonicalBase_ReturnsHtmlNotContainingAppRelativeChar() { const string LinkCanonicalBase = "https://linkcanonical.co/base/"; // Arrange var htmlHelper = HtmlHelperTestFactory.Create(); // Act var html = htmlHelper.SeoLinkCanonical( TestData.TestAppRelativeLinkCanonical, linkCanonicalBase: LinkCanonicalBase); // Assert bool htmlContainsAppRelativeChar = html.Contains("~"); Assert.False(htmlContainsAppRelativeChar); }
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); }