diff --git a/Assets/Tests/LMVLibraryImageFetchingTests.cs b/Assets/Tests/LMVLibraryImageFetchingTests.cs index b25a61b..5f3c2c9 100644 --- a/Assets/Tests/LMVLibraryImageFetchingTests.cs +++ b/Assets/Tests/LMVLibraryImageFetchingTests.cs @@ -65,42 +65,7 @@ namespace Raindrop.Tests Assert.IsTrue(instance.Client.Network.Connected, "Client is not connected to the grid"); } - //able to reach google.com, synchronous - [UnityTest] - public IEnumerator NetSync_Get_Google() - { - // Create the GET request. - var destinationUrl = new Uri("http://www.google.com"); - HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(destinationUrl); - request.Method = "GET"; - - // Content type is JSON. - request.ContentType = "application/json"; - - // Fill body. - // byte[] contentBytes = new UTF8Encoding().GetBytes(data); - // request.ContentLength = contentBytes.LongLength; - // request.GetRequestStream().Write(contentBytes, 0, contentBytes.Length); - - try - { - using(HttpWebResponse response = (HttpWebResponse)request.GetResponse()) - { - Debug.Log("Publish Response: " + (int)response.StatusCode + ", " + response.StatusDescription); - if((int)response.StatusCode == 200) - { - Debug.Log("passed."); - } - } - } - catch(Exception e) - { - Debug.LogError(e.ToString()); - } - Assert.Pass(); - yield break; - } - + // DownloadManager variant of 'wtf' WebRequest. // (Used to) Fail in unity editor, android target, net standard 2.0 // (Used to) unity completely hang at call to HttpWebRequest.BeginGetResponse() diff --git a/Assets/Tests/NetTests.meta b/Assets/Tests/NetTests.meta new file mode 100644 index 0000000..db0080e --- /dev/null +++ b/Assets/Tests/NetTests.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 27e753c1d16c45dd850480d93337a20b +timeCreated: 1642791855 \ No newline at end of file diff --git a/Assets/Tests/NetTests/NetworkTests.cs b/Assets/Tests/NetTests/NetworkTests.cs new file mode 100644 index 0000000..e2eeade --- /dev/null +++ b/Assets/Tests/NetTests/NetworkTests.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections; +using System.Net; +using NUnit.Framework; +using UnityEngine; +using UnityEngine.TestTools; + +namespace Raindrop.Tests.NetTests +{ + public class NetworkTests + { + //able to reach google.com, synchronous + [UnityTest] + public IEnumerator NetSync_Get_Google() + { + // Create the GET request. + var destinationUrl = new Uri("http://www.google.com"); + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(destinationUrl); + request.Method = "GET"; + + // Content type is JSON. + request.ContentType = "application/json"; + + // Fill body. + // byte[] contentBytes = new UTF8Encoding().GetBytes(data); + // request.ContentLength = contentBytes.LongLength; + // request.GetRequestStream().Write(contentBytes, 0, contentBytes.Length); + + try + { + using(HttpWebResponse response = (HttpWebResponse)request.GetResponse()) + { + Debug.Log("Publish Response: " + (int)response.StatusCode + ", " + response.StatusDescription); + if((int)response.StatusCode == 200) + { + Debug.Log("passed."); + } + } + } + catch(Exception e) + { + Debug.LogError(e.ToString()); + } + Assert.Pass(); + yield break; + } + + } +} \ No newline at end of file diff --git a/Assets/Tests/NetTests/NetworkTests.cs.meta b/Assets/Tests/NetTests/NetworkTests.cs.meta new file mode 100644 index 0000000..2e21eb8 --- /dev/null +++ b/Assets/Tests/NetTests/NetworkTests.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b320bce51763443ab8d1d5b0160f2c1b +timeCreated: 1642791864 \ No newline at end of file