Skip to content

Commit 5987dbc

Browse files
test - refactor
Using System.IO.File. Migrating into the testproject's runtime tests. Encapsulating within UNITY_EDITOR define. Removed the iPhone platform exclusion.
1 parent 11b01cd commit 5987dbc

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

com.unity.netcode.gameobjects/Tests/Runtime/HelpUrlTests.cs renamed to testproject/Assets/Tests/Runtime/HelpUrlTests.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
2-
1+
#if UNITY_EDITOR
32
using System;
3+
using System.IO;
44
using System.Collections;
55
using System.Collections.Generic;
66
using System.Linq;
@@ -12,9 +12,8 @@
1212
using Unity.Netcode.Runtime;
1313
using UnityEngine;
1414
using UnityEngine.TestTools;
15-
using UnityEngine.Windows;
1615

17-
namespace Unity.Netcode.RuntimeTests
16+
namespace TestProject.RuntimeTests
1817
{
1918
internal class HelpUrlTests
2019
{
@@ -23,10 +22,7 @@ internal class HelpUrlTests
2322

2423
private bool m_VerboseLogging = false;
2524

26-
// TODO: Since help URIs are only used in the editor, we should migrate this into the editor tests.
27-
// IOS platform can't run this test for some reason.
2825
[UnityTest]
29-
[UnityPlatform(exclude = new[] { RuntimePlatform.IPhonePlayer })]
3026
public IEnumerator ValidateUrlsAreValid()
3127
{
3228
var names = new List<string>();
@@ -116,7 +112,7 @@ private string ContentExistsInDocumentation(string url)
116112
{
117113
var splitFilter = url.Contains(HelpUrls.BaseManualUrl) ? HelpUrls.BaseManualUrl : HelpUrls.BaseApiUrl;
118114
var split = url.Split(splitFilter);
119-
var current = System.IO.Directory.GetCurrentDirectory().Replace("testproject", string.Empty);
115+
var current = Directory.GetCurrentDirectory().Replace("testproject", string.Empty);
120116
var filePath = $"{current}com.unity.netcode.gameobjects/Documentation~/{split[1].Replace(".html", ".md")}";
121117
try
122118
{
@@ -207,3 +203,4 @@ private void VerboseLog(string message)
207203

208204
}
209205
}
206+
#endif

com.unity.netcode.gameobjects/Tests/Runtime/HelpUrlTests.cs.meta renamed to testproject/Assets/Tests/Runtime/HelpUrlTests.cs.meta

File renamed without changes.

0 commit comments

Comments
 (0)