public void Format_NoEncoding_WithHotkey() { var formatter = new UnderscoreHotkeyFormatter(); var textWithHotkey = new TextWithHotkey("foo bar", 4); Assert.That(formatter.FormatText(textWithHotkey, false), Is.EqualTo("foo <u>b</u>ar")); }
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")); }
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<b>o</b>o b&ar")); }
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")); }
public void FormatHotkey_LowerCaseHotkey_MakesUpperCase() { var formatter = new TestableHotkeyFormatterBase(); var textWithHotkey = new TextWithHotkey("text", 'a'); Assert.That(formatter.FormatHotkey(textWithHotkey), Is.EqualTo("A")); }
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")); }
public void FormatHotkey_NoHotkey() { var formatter = new TestableHotkeyFormatterBase(); var textWithHotkey = new TextWithHotkey("text", null); Assert.That(formatter.FormatHotkey(textWithHotkey), Is.Null); }
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 'ö'>ö</x>ar")); }
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>")); }
public void Initialize_WithTextEmpty_AndHotkey() { var textWithHotkey = new TextWithHotkey("", 'X'); Assert.That(textWithHotkey.Text, Is.Empty); Assert.That(textWithHotkey.HotkeyIndex, Is.Null); Assert.That(textWithHotkey.Hotkey, Is.EqualTo('X')); }
public void Initialize_WithText_AndHotkeyIndexNull() { var textWithHotkey = new TextWithHotkey("foo bar", null); Assert.That(textWithHotkey.Text, Is.EqualTo("foo bar")); Assert.That(textWithHotkey.HotkeyIndex, Is.Null); Assert.That(textWithHotkey.Hotkey, Is.Null); }
protected override void Render(HtmlTextWriter writer) { _textWithHotkey = HotkeyParser.Parse(Text); base.Render(writer); }