示例#1
0
        public void ForceLowerCaseText()
        {
            var sanitizer = new SlugCreator();

            string before = "THIS-SHOULD-BE-FORCED-LOWERCASE";
            string after  = "this-should-be-forced-lowercase";

            string result = sanitizer.Sanitize(before);

            result.ShouldBe(after);
        }
示例#2
0
        public void IgnoreTextCase()
        {
            var config = new SlugConfiguration
            {
                TextCase = TextCase.Ignore
            };

            var sanitizer = new SlugCreator(config);

            string before = "This-ShouLd-Be-Left-HOw-It-iS";
            string after  = "This-ShouLd-Be-Left-HOw-It-iS";

            string result = sanitizer.Sanitize(before);

            result.ShouldBe(after);
        }
示例#3
0
        public void SeparatorTests2()
        {
            var config = new SlugConfiguration
            {
                Separator = "_"
            };

            var sanitizer = new SlugCreator(config);

            string before = "separate this text with hyphens";
            string after  = "separate_this_text_with_hyphens";

            string result = sanitizer.Sanitize(before);

            result.ShouldBe(after);
        }
示例#4
0
        public void ForceUpperCaseText()
        {
            var config = new SlugConfiguration
            {
                TextCase = TextCase.UpperCase
            };

            var sanitizer = new SlugCreator(config);

            string before = "this-should-be-forced-lowercase";
            string after  = "THIS-SHOULD-BE-FORCED-LOWERCASE";

            string result = sanitizer.Sanitize(before);

            result.ShouldBe(after);
        }