public void EscapeTest_FSharp_UseShortEscape(char original, string escaped)
        {
            CharEscapeOptions options = new CharEscapeOptions()
            {
                EscapeLanguage = CharEscapeLanguage.FSharp,
                UseShortEscape = true
            };

            Assert.Equal(escaped, CharUtils.Escape(original, options));
        }
        public void EscapeTest_CSharp_LowerCaseU4(char original, string escaped)
        {
            CharEscapeOptions options = new CharEscapeOptions()
            {
                EscapeLanguage = CharEscapeLanguage.CSharp,
                EscapeLetter   = CharEscapeLetter.LowerCaseU4
            };

            Assert.Equal(escaped, CharUtils.Escape(original, options));
        }
        public void EscapeTest_FSharp_None3(char original, string escaped)
        {
            CharEscapeOptions options = new CharEscapeOptions()
            {
                EscapeLanguage = CharEscapeLanguage.FSharp,
                EscapeLetter   = CharEscapeLetter.None3
            };

            Assert.Equal(escaped, CharUtils.Escape(original, options));
        }
        public void EscapeTest_FSharp_UseLowerCaseHex(char original, string escaped)
        {
            CharEscapeOptions options = new CharEscapeOptions()
            {
                EscapeLanguage  = CharEscapeLanguage.FSharp,
                EscapeLetter    = CharEscapeLetter.LowerCaseU4,
                UseLowerCaseHex = true
            };

            Assert.Equal(escaped, CharUtils.Escape(original, options));
        }
        public void EscapeTest_PowerShell()
        {
            CharEscapeOptions options = new CharEscapeOptions()
            {
                EscapeLanguage = CharEscapeLanguage.PowerShell
            };

            char original = 'A';

            Assert.Throws <ArgumentException>(() => CharUtils.Escape(original, options));
        }
        public void EscapeTest_FSharp_AddQuotes()
        {
            CharEscapeOptions options = new CharEscapeOptions()
            {
                EscapeLanguage = CharEscapeLanguage.FSharp
            };

            char original = 'A';

            Assert.Equal("\'\\u0041\'", CharUtils.Escape(original, options, true));
        }
        public void EscapeTest_CSharp_LowerCaseU6()
        {
            CharEscapeOptions options = new CharEscapeOptions()
            {
                EscapeLanguage = CharEscapeLanguage.CSharp,
                EscapeLetter   = CharEscapeLetter.LowerCaseU6
            };

            char original = 'A';

            Assert.Throws <ArgumentException>(() => CharUtils.Escape(original, options));
        }
        public void EscapeTest_FSharp_None3_Fallback()
        {
            CharEscapeOptions options = new CharEscapeOptions()
            {
                EscapeLanguage = CharEscapeLanguage.FSharp,
                EscapeLetter   = CharEscapeLetter.None3
            };

            char original = 'ㄱ';

            options.EscapeLetterFallback = CharEscapeLetter.LowerCaseU4;
            Assert.Equal("\\u3131", CharUtils.Escape(original, options));

            options.EscapeLetterFallback = CharEscapeLetter.UpperCaseU8;
            Assert.Equal("\\U00003131", CharUtils.Escape(original, options));

            options.EscapeLetterFallback = CharEscapeLetter.None3; // bad
            Assert.Throws <ArgumentException>(() => CharUtils.Escape(original, options));
        }