Пример #1
0
        public void FormatText_NoEncoding_WithHotkeyAtStart()
        {
            var formatter      = new TestableHotkeyFormatterBase();
            var textWithHotkey = new TextWithHotkey("foo bar", 0);

            Assert.That(formatter.FormatText(textWithHotkey, false), Is.EqualTo("<x 'f'>f</x>oo bar"));
        }
Пример #2
0
        public void FormatText_WithHtmlEncoding_NoHotkey()
        {
            var formatter      = new TestableHotkeyFormatterBase();
            var textWithHotkey = new TextWithHotkey("f<b>o</b>o b&ar", null);

            Assert.That(formatter.FormatText(textWithHotkey, true), Is.EqualTo("f&lt;b&gt;o&lt;/b&gt;o b&amp;ar"));
        }
Пример #3
0
        public void FormatText_NoEncoding_WithHotkey()
        {
            var formatter      = new TestableHotkeyFormatterBase();
            var textWithHotkey = new TextWithHotkey("foo b&ar", 4);

            Assert.That(formatter.FormatText(textWithHotkey, false), Is.EqualTo("foo <x 'b'>b</x>&ar"));
        }
Пример #4
0
        public void FormatText_NoEncoding_NoHotkey()
        {
            var formatter      = new TestableHotkeyFormatterBase();
            var textWithHotkey = new TextWithHotkey("f<b>o</b>o b&ar", null);

            Assert.That(formatter.FormatText(textWithHotkey, false), Is.EqualTo("f<b>o</b>o b&ar"));
        }
Пример #5
0
        public void FormatHotkey_LowerCaseHotkey_MakesUpperCase()
        {
            var formatter      = new TestableHotkeyFormatterBase();
            var textWithHotkey = new TextWithHotkey("text", 'a');

            Assert.That(formatter.FormatHotkey(textWithHotkey), Is.EqualTo("A"));
        }
Пример #6
0
        public void FormatHotkey_NoHotkey()
        {
            var formatter      = new TestableHotkeyFormatterBase();
            var textWithHotkey = new TextWithHotkey("text", null);

            Assert.That(formatter.FormatHotkey(textWithHotkey), Is.Null);
        }
Пример #7
0
        public void FormatText_WithHtmlEncoding_WithEncodedHotkey()
        {
            var formatter      = new TestableHotkeyFormatterBase();
            var textWithHotkey = new TextWithHotkey("foo öar", 4);

            Assert.That(formatter.FormatText(textWithHotkey, true), Is.EqualTo("foo <x '&#246;'>&#246;</x>ar"));
        }
Пример #8
0
        public void FormatText_NoEncoding_WithHotkeyAtEnd()
        {
            var formatter      = new TestableHotkeyFormatterBase();
            var textWithHotkey = new TextWithHotkey("foo bar", 6);

            Assert.That(formatter.FormatText(textWithHotkey, false), Is.EqualTo("foo ba<x 'r'>r</x>"));
        }