using NUnit.Framework;
using System;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using System.Collections.Generic;
using LeanCloud;
using LeanCloud.Storage;
using LeanCloud.Realtime;
using static NUnit.Framework.TestContext;
///
/// Emoji 消息
///
class EmojiMessage : LCIMTypedMessage {
public const int EmojiMessageType = 1;
public override int MessageType => EmojiMessageType;
public string Ecode {
get {
return data["ecode"] as string;
} set {
data["ecode"] = value;
}
}
}
namespace Realtime.Test {
public class Message {
private LCIMClient m1;
private LCIMClient m2;
private LCIMConversation conversation;
[SetUp]
public async Task SetUp() {
LCLogger.LogDelegate += Utils.Print;
LCApplication.Initialize("ikGGdRE2YcVOemAaRbgp1xGJ-gzGzoHsz", "NUKmuRbdAhg1vrb2wexYo1jo", "https://ikggdre2.lc-cn-n1-shared.com");
m1 = new LCIMClient("m1");
m2 = new LCIMClient("m2");
await m1.Open();
await m2.Open();
conversation = await m1.CreateConversation(new string[] { "m2" });
}
[TearDown]
public async Task TearDown() {
await m1.Close();
await m2.Close();
LCLogger.LogDelegate -= Utils.Print;
}
[Test]
[Order(0)]
public async Task Send() {
TaskCompletionSource