Initial commit: Client Doc docs Server Tools
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using System.IO;
|
||||
using Xunit;
|
||||
|
||||
namespace XWorld.PublishTool.Tests
|
||||
{
|
||||
public class RpsClientUiTests
|
||||
{
|
||||
[Fact]
|
||||
public void RpsClient_UsesPackagedUgUiPrefab_InsteadOfImgui()
|
||||
{
|
||||
string source = File.ReadAllText(Path.Combine(
|
||||
RepoRoot(),
|
||||
"Client",
|
||||
"Assets",
|
||||
"MiniGames",
|
||||
"RockPaperScissors",
|
||||
"scripts~",
|
||||
"Client",
|
||||
"RpsGameClient.cs"));
|
||||
|
||||
Assert.Contains("UI_RockPaperScissors.prefab", source);
|
||||
Assert.Contains("_ctx.Assets.Load", source);
|
||||
Assert.DoesNotContain("OnGUI", source);
|
||||
Assert.DoesNotContain("GUILayout.", source);
|
||||
}
|
||||
|
||||
private static string RepoRoot()
|
||||
{
|
||||
var dir = new DirectoryInfo(Directory.GetCurrentDirectory());
|
||||
while (dir != null)
|
||||
{
|
||||
if (File.Exists(Path.Combine(dir.FullName, "Client", "Assets", "MiniGames", "RockPaperScissors", "publish.json")))
|
||||
return dir.FullName;
|
||||
dir = dir.Parent;
|
||||
}
|
||||
|
||||
throw new DirectoryNotFoundException("Could not locate repo root.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user