コード例 #1
0
        public void GetTitle_TitleEmptyAndBaseTitleNotEmpty_ReturnsBaseTitle()
        {
            // Arrange
            var seoHelper = SeoHelperTestFactory.Create();

            seoHelper.BaseTitle = TestData.TestBaseTitle;

            // Act
            var title = SeoHelperTitleHelper.GetTitle(seoHelper);

            // Assert
            Assert.Equal(TestData.TestBaseTitle, title);
        }
コード例 #2
0
        public void GetTitle_TitleAndBaseTitleNotEmpty_ReturnsTitleWithTitleAndBaseTitle()
        {
            // Arrange
            var seoHelper = SeoHelperTestFactory.Create();

            seoHelper.BaseTitle = TestData.TestBaseTitle;
            seoHelper.Title     = TestData.TestTitle;

            // Act
            var title = SeoHelperTitleHelper.GetTitle(seoHelper);

            // Assert
            bool titleEndsWithSiteTitle   = title.EndsWith(TestData.TestBaseTitle);
            bool titleStartsWithPageTitle = title.StartsWith(TestData.TestTitle);

            Assert.True(titleEndsWithSiteTitle);
            Assert.True(titleStartsWithPageTitle);
        }