예제 #1
0
        public void CanBuildValidUrlWithInvalidCharsBetweenSpaces()
        {
            var title = "Too ^&* many ;'\"[]\\_+= invalidChars";
            var url = UrlSeoUtils.BuildValidUrl(title);
            var expected = "too-many-invalidchars";

            Assert.AreEqual(expected, url);
        }
예제 #2
0
        public void CanBuildValidUrlWithSequentialDashes()
        {
            var title = "Too---many---dashes";
            var url = UrlSeoUtils.BuildValidUrl(title);
            var expected = "too-many-dashes";

            Assert.AreEqual(expected, url);
        }
예제 #3
0
        public void CanBuildValidUrlWithOutAnyInvalidChars()
        {
            var title = "This is a post about optimizing a title";
            var url = UrlSeoUtils.BuildValidUrl(title);
            var expected = "this-is-a-post-about-optimizing-a-title";

            Assert.AreEqual(expected, url);
        }
예제 #4
0
        public void CanBuildValidUrlWithInvalidChars()
        {
            var title = "Really~1@# Bad-*7s;:Title";
            var url = UrlSeoUtils.BuildValidUrl(title);
            var expected = "really1-bad-7stitle";

            Assert.AreEqual(expected, url);
        }
예제 #5
0
        public void CanBuildValidUrlWithSequentialSpaces()
        {
            string title    = "Too    many    spaces";
            string url      = UrlSeoUtils.BuildValidUrl(title);
            string expected = "too-many-spaces";

            Assert.AreEqual(expected, url);
        }