public void TestRelativeToAbsolute() { string absPath = UnityPathUtils.Combine(Application.dataPath, "Things/test.txt"); string relPath = UnityPathUtils.Combine("Assets", "Things/test.txt"); Assert.That( UnityPathUtils.RelativeToAbsolute(relPath), Is.EqualTo(absPath) ); }
public void TestRelativeToAbsolute() { // Gotta do this because we need consistent directory separators. string dataPath = Application.dataPath.Replace('/', Path.DirectorySeparatorChar); string basePath = UnityPathUtils.Combine("Things", "test.txt"); string absPath = UnityPathUtils.Combine(dataPath, basePath); string relPath = UnityPathUtils.Combine("Assets", basePath); Assert.That( UnityPathUtils.RelativeToAbsolute(relPath), Is.EqualTo(absPath) ); }