/// <summary> /// Constructor. /// </summary> private SDKManager() { SdkEngine = new SdkEngine(true); Status = new SdkStatus(); _backgroundTaskManager = new BackgroundTaskManager(); _backgroundTaskManager.RegisterOnProgressEventHandler(); }
public async Task TestBackendStatus() { SdkStatus status = new SdkStatus(); Assert.IsTrue(await status.CheckResolversReachable(), "Resolver reachable failed"); ((MockApiConnection) ServiceManager.ApiConnction).FailNetwork = true; try { await ServiceManager.ApiConnction.LoadSettings(); } catch (Exception) { } Assert.IsFalse(await status.CheckResolversReachable(), "Unreachable Resolver reachable failed"); ((MockApiConnection) ServiceManager.ApiConnction).FailNetwork = false; await ServiceManager.ApiConnction.LoadSettings(); Assert.IsTrue(await status.CheckResolversReachable(), "Resolver reachable failed"); }
public async Task TestInvalidApiKeyValidation() { SdkStatus status = new SdkStatus(); SdkConfiguration.ApiKey = "123"; Assert.IsFalse(await status.CheckApiKeysValid(), "ApiKey is not invalid"); }
public async Task TestApiKeyValidation() { SdkStatus status = new SdkStatus(); Assert.IsTrue(await status.CheckApiKeysValid(), "ApiKey is not valid"); }