generated from CareBoo/UPMTemplate-2020
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(dotnet): add warning for using dotnet sdk clients with WebGL builds
- Loading branch information
1 parent
67d77b0
commit c184118
Showing
2 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 9 additions & 12 deletions
21
Tests/Runtime/Algorand.Unity.IntegrationTests/DotnetSdk/Algod/DotnetAlgodClientTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
using System.Collections; | ||
using System.Threading; | ||
using Cysharp.Threading.Tasks; | ||
using NUnit.Framework; | ||
using UnityEngine; | ||
using UnityEngine.TestTools; | ||
|
||
[TestFixture] | ||
public class DotnetAlgodClientTest : AlgodClientTestFixture | ||
{ | ||
[Test] | ||
public void InstantiatingClientShouldThrowNoErrors() | ||
{ | ||
var defaultAlgod = AlgoApiClientSettings.DefaultAlgod; | ||
var api = (Algorand.Algod.DefaultApi)defaultAlgod; | ||
} | ||
|
||
[UnityTest] | ||
public IEnumerator SendSimpleRequestShouldThrowNoErrors() => UniTask.ToCoroutine(async () => | ||
{ | ||
var defaultAlgod = AlgoApiClientSettings.DefaultAlgod; | ||
var api = (Algorand.Algod.DefaultApi)defaultAlgod; | ||
#if UNITY_WEBGL && !UNITY_EDITOR | ||
Assert.Ignore("HttpClient is not supported in WebGL"); | ||
#else | ||
SynchronizationContext.SetSynchronizationContext(new UniTaskSynchronizationContext()); | ||
var api = AlgoApiClientSettings.DefaultAlgod.ToDefaultApi(); | ||
var response = await api.GetStatusAsync(); | ||
Debug.Log($"Last Round: {response.LastRound}"); | ||
Assert.Greater(response.LastRound, 0); | ||
#endif | ||
}); | ||
} | ||
} |