17 lines
612 B
C#
17 lines
612 B
C#
using System.IO;
|
|
using System.Reflection;
|
|
using UnityEditor.PackageManager;
|
|
|
|
namespace Unity.Tutorials.Core.Editor.Tests
|
|
{
|
|
public class TestBase
|
|
{
|
|
// Returns the correct path (forward slash used as the separator) depending whether we're running the tests locally or as a separate package.
|
|
protected static string GetTestAssetPath(string relativeAssetPath)
|
|
{
|
|
var packagePath = PackageInfo.FindForAssembly(Assembly.GetExecutingAssembly()).assetPath;
|
|
return Path.Combine($"{packagePath}/Tests/Editor", relativeAssetPath).Replace('\\', '/');
|
|
}
|
|
}
|
|
}
|