chore: 调整命名空间
parent
7380cdfdc2
commit
c0c7a6b49f
|
|
@ -2,6 +2,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Collections.Generic;
|
||||||
using LeanCloud;
|
using LeanCloud;
|
||||||
using LeanCloud.Common;
|
using LeanCloud.Common;
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
|
|
@ -171,9 +172,10 @@ namespace Realtime.Test {
|
||||||
string clientId = Guid.NewGuid().ToString();
|
string clientId = Guid.NewGuid().ToString();
|
||||||
LCIMClient client = new LCIMClient(clientId);
|
LCIMClient client = new LCIMClient(clientId);
|
||||||
LCIMConversation conversation = await m1.CreateConversation(new string[] { clientId });
|
LCIMConversation conversation = await m1.CreateConversation(new string[] { clientId });
|
||||||
await client.Open();
|
|
||||||
LCIMTextMessage textMessage = new LCIMTextMessage("hello");
|
LCIMTextMessage textMessage = new LCIMTextMessage("hello");
|
||||||
await conversation.Send(textMessage);
|
await conversation.Send(textMessage);
|
||||||
|
|
||||||
client.OnUnreadMessagesCountUpdated = (convs) => {
|
client.OnUnreadMessagesCountUpdated = (convs) => {
|
||||||
foreach (LCIMConversation conv in convs) {
|
foreach (LCIMConversation conv in convs) {
|
||||||
WriteLine($"unread count: {conv.Unread}");
|
WriteLine($"unread count: {conv.Unread}");
|
||||||
|
|
@ -181,11 +183,21 @@ namespace Realtime.Test {
|
||||||
Assert.True(conv.LastMessage is LCIMTextMessage);
|
Assert.True(conv.LastMessage is LCIMTextMessage);
|
||||||
LCIMTextMessage textMsg = conv.LastMessage as LCIMTextMessage;
|
LCIMTextMessage textMsg = conv.LastMessage as LCIMTextMessage;
|
||||||
Assert.AreEqual(textMsg.Text, "hello");
|
Assert.AreEqual(textMsg.Text, "hello");
|
||||||
tcs.SetResult(true);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
await client.Open();
|
await client.Open();
|
||||||
|
|
||||||
|
client.OnMessage = (conv, msg) => {
|
||||||
|
WriteLine($"unread count: {conv.Unread}");
|
||||||
|
Assert.AreEqual(conv.Unread, 2);
|
||||||
|
Assert.True(conv.LastMessage is LCIMTextMessage);
|
||||||
|
LCIMTextMessage textMsg = conv.LastMessage as LCIMTextMessage;
|
||||||
|
Assert.AreEqual(textMsg.Text, "world");
|
||||||
|
tcs.SetResult(true);
|
||||||
|
};
|
||||||
|
textMessage = new LCIMTextMessage("world");
|
||||||
|
await conversation.Send(textMessage);
|
||||||
|
|
||||||
await tcs.Task;
|
await tcs.Task;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -230,5 +242,41 @@ namespace Realtime.Test {
|
||||||
|
|
||||||
await tcs.Task;
|
await tcs.Task;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Order(8)]
|
||||||
|
public async Task MentionList() {
|
||||||
|
TaskCompletionSource<object> tcs = new TaskCompletionSource<object>();
|
||||||
|
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<string> { m2.Id }
|
||||||
|
};
|
||||||
|
await conversation.Send(textMessage);
|
||||||
|
|
||||||
|
await tcs.Task;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Order(9)]
|
||||||
|
public async Task MentionAll() {
|
||||||
|
TaskCompletionSource<object> tcs = new TaskCompletionSource<object>();
|
||||||
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using LeanCloud.Realtime.Protocol;
|
using LeanCloud.Realtime.Internal.Protocol;
|
||||||
using Google.Protobuf;
|
using Google.Protobuf;
|
||||||
|
|
||||||
namespace Realtime.Test {
|
namespace Realtime.Test {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using LeanCloud;
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
using LeanCloud.Common;
|
|
||||||
|
|
||||||
namespace LeanCloud.Test {
|
namespace Storage.Test {
|
||||||
public class ACLTest {
|
public class ACLTest {
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp() {
|
public void SetUp() {
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using LeanCloud;
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
using LeanCloud.Common;
|
|
||||||
|
|
||||||
namespace LeanCloud.Test {
|
namespace Storage.Test {
|
||||||
public class CloudTest {
|
public class CloudTest {
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp() {
|
public void SetUp() {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
using LeanCloud.Common;
|
|
||||||
|
|
||||||
namespace LeanCloud.Test {
|
namespace Storage.Test {
|
||||||
public class ExceptionTest {
|
public class ExceptionTest {
|
||||||
[Test]
|
[Test]
|
||||||
public void LeanCloudException() {
|
public void LeanCloudException() {
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,13 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using LeanCloud;
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
using LeanCloud.Common;
|
|
||||||
|
|
||||||
namespace LeanCloud.Test {
|
namespace Storage.Test {
|
||||||
public class FileTest {
|
public class FileTest {
|
||||||
static readonly string AvatarFilePath = "../../../assets/hello.png";
|
static readonly string AvatarFilePath = "../../../../assets/hello.png";
|
||||||
static readonly string APKFilePath = "../../../assets/test.apk";
|
static readonly string APKFilePath = "../../../../assets/test.apk";
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp() {
|
public void SetUp() {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
|
|
||||||
namespace LeanCloud.Test {
|
namespace Storage.Test {
|
||||||
public class GeoTest {
|
public class GeoTest {
|
||||||
[Test]
|
[Test]
|
||||||
public void Calculate() {
|
public void Calculate() {
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@ using NUnit.Framework;
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using LeanCloud;
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
using LeanCloud.Common;
|
|
||||||
|
|
||||||
namespace LeanCloud.Test {
|
namespace Storage.Test {
|
||||||
public class ObjectTest {
|
public class ObjectTest {
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp() {
|
public void SetUp() {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using LeanCloud;
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
using LeanCloud.Common;
|
|
||||||
|
|
||||||
namespace LeanCloud.Test {
|
namespace Storage.Test {
|
||||||
public class OperationTest {
|
public class OperationTest {
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp() {
|
public void SetUp() {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using LeanCloud;
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
using LeanCloud.Common;
|
|
||||||
|
|
||||||
namespace LeanCloud.Test {
|
namespace Storage.Test {
|
||||||
public class QueryTest {
|
public class QueryTest {
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp() {
|
public void SetUp() {
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using LeanCloud;
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
using LeanCloud.Common;
|
|
||||||
|
|
||||||
namespace LeanCloud.Test {
|
namespace Storage.Test {
|
||||||
public class RelationTest {
|
public class RelationTest {
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp() {
|
public void SetUp() {
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,10 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Linq;
|
using LeanCloud;
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
using LeanCloud.Common;
|
|
||||||
|
|
||||||
namespace LeanCloud.Test {
|
namespace Storage.Test {
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class RoleTest {
|
public class RoleTest {
|
||||||
[SetUp]
|
[SetUp]
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using LeanCloud;
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
using LeanCloud.Common;
|
|
||||||
|
|
||||||
namespace LeanCloud.Test {
|
namespace Storage.Test {
|
||||||
internal class Hello : LCObject {
|
internal class Hello : LCObject {
|
||||||
internal World World => this["objectValue"] as World;
|
internal World World => this["objectValue"] as World;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using LeanCloud;
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
using LeanCloud.Common;
|
|
||||||
|
|
||||||
namespace LeanCloud.Test {
|
namespace Storage.Test {
|
||||||
public class UserTest {
|
public class UserTest {
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp() {
|
public void SetUp() {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
using System;
|
using NUnit.Framework;
|
||||||
using LeanCloud;
|
using LeanCloud;
|
||||||
using LeanCloud.Common;
|
|
||||||
using NUnit.Framework;
|
|
||||||
|
|
||||||
namespace LeanCloud.Test {
|
namespace Storage.Test {
|
||||||
public static class Utils {
|
public static class Utils {
|
||||||
internal static void Print(LCLogLevel level, string info) {
|
internal static void Print(LCLogLevel level, string info) {
|
||||||
switch (level) {
|
switch (level) {
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Loading…
Reference in New Issue