csharp-sdk-upm/Realtime/Realtime.Test/Utils.cs

36 lines
1.1 KiB
C#
Raw Normal View History

using System;
using LeanCloud;
using NUnit.Framework;
namespace Realtime.Test {
public static class Utils {
2020-12-24 10:58:16 +08:00
internal static void SetUp() {
LCLogger.LogDelegate += Print;
2021-04-07 18:08:17 +08:00
LCApplication.Initialize("3zWMOXuO9iSdnjXM942i6DdI-gzGzoHsz",
"bkwiNq4Tj417eUaHlTWS5sPm",
"https://3zwmoxuo.lc-cn-n1-shared.com");
2020-12-24 10:58:16 +08:00
}
internal static void TearDown() {
LCLogger.LogDelegate -= Print;
}
internal static void Print(LCLogLevel level, string info) {
switch (level) {
case LCLogLevel.Debug:
2020-06-23 15:25:30 +08:00
TestContext.Out.WriteLine($"[DEBUG] {DateTime.Now} {info}\n");
break;
case LCLogLevel.Warn:
2020-06-23 15:25:30 +08:00
TestContext.Out.WriteLine($"[WARNING] {DateTime.Now} {info}\n");
break;
case LCLogLevel.Error:
2020-06-23 15:25:30 +08:00
TestContext.Out.WriteLine($"[ERROR] {DateTime.Now} {info}\n");
break;
default:
TestContext.Out.WriteLine(info);
break;
}
}
}
}