Esempio n. 1
0
        public void Regular_I_Returned_With_Turkish_Culture_And_CapitalizeFirstCharacterInvariantCulture_Option()
        {
            string input    = "invariantCulture";
            string expected = "Invariant Culture";

            Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("tr");

            string result = RegexUtility.FormatCamelCase(input, camelCaseOptions: CamelCaseOptions.CapitalizeFirstCharacterInvariantCulture);

            result.ShouldBe(expected);
        }
Esempio n. 2
0
        public void Can_Format_CamelCase_And_Capitalize_First_Character(string input, string expected)
        {
            string result = RegexUtility.FormatCamelCase(input, camelCaseOptions: CamelCaseOptions.CapitalizeFirstCharacter);

            result.ShouldBe(expected);
        }
Esempio n. 3
0
        public void Can_Format_CamelCase_Inputs_With_Numbers(string input, string expected)
        {
            string result = RegexUtility.FormatCamelCase(input);

            result.ShouldBe(expected);
        }
Esempio n. 4
0
        public void CamelCase_Format_Throws_Exception_For_Null_Or_Empty_Delimiter(string delimiter)
        {
            var ex = Should.Throw <ArgumentException>(() => RegexUtility.FormatCamelCase("PascalCase", delimiter));

            ex.ParamName.ShouldBe("delimiter");
        }
Esempio n. 5
0
        public void Can_Format_CamelCase_With_Given_Delimiter(string input, string expected, string delimiter)
        {
            string result = RegexUtility.FormatCamelCase(input, delimiter);

            result.ShouldBe(expected);
        }
Esempio n. 6
0
        public void Can_Format_CamelCase_With_Spaces_By_Default(string input, string expected)
        {
            string result = RegexUtility.FormatCamelCase(input);

            result.ShouldBe(expected);
        }
Esempio n. 7
0
        public void CamelCase_Format_Of_Single_Word_Returns_Original_Word_Unmodified(string input)
        {
            string result = RegexUtility.FormatCamelCase(input);

            result.ShouldBe(input);
        }