diff --git a/Test/Realtime.Test/Message.cs b/Test/Realtime.Test/Message.cs index cdebaaf..3de142e 100644 --- a/Test/Realtime.Test/Message.cs +++ b/Test/Realtime.Test/Message.cs @@ -2,6 +2,7 @@ using System; using System.Collections.ObjectModel; using System.Threading.Tasks; +using System.Collections.Generic; using LeanCloud; using LeanCloud.Common; using LeanCloud.Storage; @@ -230,5 +231,41 @@ namespace Realtime.Test { await tcs.Task; } + + [Test] + [Order(8)] + public async Task MentionList() { + TaskCompletionSource tcs = new TaskCompletionSource(); + m2.OnMessage = (conv, msg) => { + Assert.True(msg.Mentioned); + Assert.True(msg.MentionIdList.Contains(m2.Id)); + tcs.SetResult(null); + }; + + LCIMTextMessage textMessage = new LCIMTextMessage("hello") { + MentionIdList = new List { m2.Id } + }; + await conversation.Send(textMessage); + + await tcs.Task; + } + + [Test] + [Order(9)] + public async Task MentionAll() { + TaskCompletionSource tcs = new TaskCompletionSource(); + m2.OnMessage = (conv, msg) => { + Assert.True(msg.Mentioned); + Assert.True(msg.MentionAll); + tcs.SetResult(null); + }; + + LCIMTextMessage textMessage = new LCIMTextMessage("world") { + MentionAll = true + }; + await conversation.Send(textMessage); + + await tcs.Task; + } } }