From 8a036a6354a543b1f0f2c6c3415ea2551139aff3 Mon Sep 17 00:00:00 2001 From: oneRain Date: Tue, 28 Apr 2020 11:20:51 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E9=87=8D=E5=91=BD=E5=90=8D=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E7=B1=BB=E5=9E=8B=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Test/Realtime.Test/Message.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Test/Realtime.Test/Message.cs b/Test/Realtime.Test/Message.cs index 01083c5..cdebaaf 100644 --- a/Test/Realtime.Test/Message.cs +++ b/Test/Realtime.Test/Message.cs @@ -10,12 +10,12 @@ using LeanCloud.Realtime; using static NUnit.Framework.TestContext; /// -/// 自定义消息 +/// Emoji 消息 /// -class CustomMessage : LCIMTypedMessage { - public const int CustomMessageType = 1; +class EmojiMessage : LCIMTypedMessage { + public const int EmojiMessageType = 1; - public override int MessageType => CustomMessageType; + public override int MessageType => EmojiMessageType; public string Ecode { get { @@ -215,18 +215,18 @@ namespace Realtime.Test { public async Task Custom() { TaskCompletionSource tcs = new TaskCompletionSource(); // 注册自定义类型消息 - LCIMTypedMessage.Register(CustomMessage.CustomMessageType, - () => new CustomMessage()); + LCIMTypedMessage.Register(EmojiMessage.EmojiMessageType, + () => new EmojiMessage()); m2.OnMessage = (conv, msg) => { - Assert.True(msg is CustomMessage); - CustomMessage customMsg = msg as CustomMessage; - Assert.AreEqual(customMsg.Ecode, "#0123"); + Assert.True(msg is EmojiMessage); + EmojiMessage emojiMsg = msg as EmojiMessage; + Assert.AreEqual(emojiMsg.Ecode, "#0123"); tcs.SetResult(null); }; - CustomMessage customMessage = new CustomMessage { + EmojiMessage emojiMessage = new EmojiMessage { Ecode = "#0123" }; - await conversation.Send(customMessage); + await conversation.Send(emojiMessage); await tcs.Task; }