[smuxi: 152/179] Engine-Tests: add test-case for parsing emojis in messages
- From: Mirco M. M. Bauer <mmmbauer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [smuxi: 152/179] Engine-Tests: add test-case for parsing emojis in messages
- Date: Sat, 4 Nov 2017 05:50:28 +0000 (UTC)
commit 15cae898cc4230ade816fba74346a0c68883f38f
Author: Mirco Bauer <meebey meebey net>
Date: Sat Jun 3 09:50:31 2017 +0800
Engine-Tests: add test-case for parsing emojis in messages
src/Engine-Tests/MessageBuilderTests.cs | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/src/Engine-Tests/MessageBuilderTests.cs b/src/Engine-Tests/MessageBuilderTests.cs
index 63c591a..5d3d847 100644
--- a/src/Engine-Tests/MessageBuilderTests.cs
+++ b/src/Engine-Tests/MessageBuilderTests.cs
@@ -310,9 +310,12 @@ namespace Smuxi.Engine
builder.AppendFormat("{{{{virtual {0}}}}}", "hugs");
}
- void TestMessage(string message, MessageModel expectedMsg)
+ void TestMessage(string message, MessageModel expectedMsg, MessageBuilderSettings settings = null)
{
var builder = new MessageBuilder();
+ if (settings != null) {
+ builder.Settings = settings;
+ }
builder.TimeStamp = DateTime.MinValue;
builder.AppendMessage(message);
var actualMsg = builder.ToMessage();
@@ -749,5 +752,20 @@ namespace Smuxi.Engine
builder.Append(new TextMessagePartModel(") bar"));
TestMessage(msg, builder.ToMessage());
}
+
+ [Test]
+ public void AppendMessageWithEmojis()
+ {
+ var msg = "foo :smiley: bar";
+ var builder = new MessageBuilder();
+ builder.Settings.Emojis = true;
+ builder.TimeStamp = DateTime.MinValue;
+ builder.Append(new TextMessagePartModel("foo "));
+ builder.Append(
+ new ImageMessagePartModel("smuxi-emoji://smiley", ":smiley:")
+ );
+ builder.Append(new TextMessagePartModel(" bar"));
+ TestMessage(msg, builder.ToMessage(), builder.Settings);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]