Esempio n. 1
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);
        }
Esempio n. 2
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);
        }
Esempio n. 3
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);
        }