Initial commit: Client Doc docs Server Tools

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
ud18010
2026-07-10 10:24:29 +08:00
co-authored by Cursor
commit 7e35d8da31
3374 changed files with 680813 additions and 0 deletions
@@ -0,0 +1,34 @@
using Xunit;
using XWorld.PublishTool;
namespace XWorld.PublishTool.Tests
{
public class CliOptionsTests
{
[Fact]
public void Parse_AllArgs_Ok()
{
var o = CliOptions.Parse(new[]
{ "--mode", "client", "--src", "S", "--out", "O", "--spec", "spec.json", "--key", "k.pem" });
Assert.Equal("client", o.Mode);
Assert.Equal("S", o.Src);
Assert.Equal("O", o.Out);
Assert.Equal("spec.json", o.SpecPath);
Assert.Equal("k.pem", o.KeyPath);
}
[Fact]
public void Parse_KeyOptional()
{
var o = CliOptions.Parse(new[] { "--mode", "server", "--src", "S", "--out", "O", "--spec", "sp" });
Assert.Null(o.KeyPath);
}
[Theory]
[InlineData(new object[] { new[] { "--mode", "bogus", "--src", "S", "--out", "O", "--spec", "sp" } })]
[InlineData(new object[] { new[] { "--src", "S", "--out", "O", "--spec", "sp" } })]
[InlineData(new object[] { new[] { "--mode", "client", "--out", "O", "--spec", "sp" } })]
public void Parse_Invalid_Throws(string[] args)
=> Assert.Throws<System.ArgumentException>(() => CliOptions.Parse(args));
}
}