Beispiel #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"));
        }
Beispiel #2
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"));
        }
Beispiel #3
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"));
        }
Beispiel #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"));
        }
Beispiel #5
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"));
        }
Beispiel #6
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>"));
        }