2019-08-27 11:52:53 +08:00
|
|
|
|
using System;
|
|
|
|
|
using LeanCloud;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
|
|
namespace LeanCloudTests {
|
|
|
|
|
public static class Utils {
|
2019-08-27 15:19:19 +08:00
|
|
|
|
public static void InitNorthChina(bool master = false) {
|
|
|
|
|
if (master) {
|
2019-08-28 18:19:26 +08:00
|
|
|
|
Init("BMYV4RKSTwo8WSqt8q9ezcWF-gzGzoHsz", "pbf6Nk5seyjilexdpyrPwjSp", "https://avoscloud.com", "https://avoscloud.com", "qKH9ryRagHKvXeRRVkiUiHeb");
|
2019-08-27 15:19:19 +08:00
|
|
|
|
} else {
|
2019-08-28 18:19:26 +08:00
|
|
|
|
Init("BMYV4RKSTwo8WSqt8q9ezcWF-gzGzoHsz", "pbf6Nk5seyjilexdpyrPwjSp", "https://avoscloud.com", "https://avoscloud.com");
|
2019-08-27 15:19:19 +08:00
|
|
|
|
}
|
2019-08-27 11:52:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-08-27 15:19:19 +08:00
|
|
|
|
public static void InitEastChina(bool master = false) {
|
|
|
|
|
if (master) {
|
2019-08-28 18:19:26 +08:00
|
|
|
|
Init("4eTwHdYhMaNBUpl1SrTr7GLC-9Nh9j0Va", "GSD6DtdgGWlWolivN4qhWtlE", "https://4eTwHdYh.api.lncldapi.com", "https://4eTwHdYh.engine.lncldapi.com", "eqEp4n89h4zanWFskDDpIwL4");
|
2019-08-27 15:19:19 +08:00
|
|
|
|
} else {
|
2019-08-28 18:19:26 +08:00
|
|
|
|
Init("4eTwHdYhMaNBUpl1SrTr7GLC-9Nh9j0Va", "GSD6DtdgGWlWolivN4qhWtlE", "https://4eTwHdYh.api.lncldapi.com", "https://4eTwHdYh.engine.lncldapi.com");
|
2019-08-27 15:19:19 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void InitUS(bool master = false) {
|
|
|
|
|
if (master) {
|
2019-08-28 18:19:26 +08:00
|
|
|
|
Init("MFAS1GnOyomRLSQYRaxdgdPz-MdYXbMMI", "p42JUxdxb95K5G8187t5ba3l", "https://MFAS1GnO.api.lncldglobal.com", "https://MFAS1GnO.engine.lncldglobal.com", "Ahb1wdFLwMgKwEaEicHRXbCY");
|
2019-08-27 15:19:19 +08:00
|
|
|
|
} else {
|
2019-08-28 18:19:26 +08:00
|
|
|
|
Init("MFAS1GnOyomRLSQYRaxdgdPz-MdYXbMMI", "p42JUxdxb95K5G8187t5ba3l", "https://MFAS1GnO.api.lncldglobal.com", "https://MFAS1GnO.engine.lncldglobal.com");
|
2019-08-27 15:19:19 +08:00
|
|
|
|
}
|
2019-08-27 11:52:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-08-28 18:19:26 +08:00
|
|
|
|
static void Init(string appId, string appKey, string apiServer, string engineServer, string masterKey = null) {
|
2019-08-27 11:52:53 +08:00
|
|
|
|
AVClient.Initialize(new AVClient.Configuration {
|
2019-08-27 15:19:19 +08:00
|
|
|
|
ApplicationId = appId,
|
|
|
|
|
ApplicationKey = appKey,
|
|
|
|
|
MasterKey = masterKey,
|
2019-08-28 18:19:26 +08:00
|
|
|
|
ApiServer = apiServer,
|
2019-09-06 14:08:05 +08:00
|
|
|
|
EngineServer = engineServer
|
2019-08-27 11:52:53 +08:00
|
|
|
|
});
|
2019-08-27 15:19:19 +08:00
|
|
|
|
AVClient.UseMasterKey = !string.IsNullOrEmpty(masterKey);
|
2019-08-27 11:52:53 +08:00
|
|
|
|
AVClient.HttpLog(TestContext.Out.WriteLine);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|