Skip to content

Commit 9369e6a

Browse files
committed
refactor(Options): 重构测试程序命名空间和类可见性
- 将命名空间从 GameFrameX.Foundation.Options.Examples 改为 GameFrameX.Foundation.Tests.Options - 将 Program 类改为 public static 并重命名为 ProgramOptions - 更新 BasicUsageDemo 中的测试参数和属性描述
1 parent c0c7012 commit 9369e6a

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

GameFrameX.Foundation.Tests/Options/Demos/BasicUsageDemo.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ public class BasicDemoConfig
5454
/// <summary>
5555
/// 数据库连接字符串
5656
/// </summary>
57-
[OptionAttribute("database-url")]
57+
[OptionAttribute("database-url", Description = "xxxxxxxxxxxxxxxxxdsakfjhjhjakfhj 温热欻穿oquikocxkzuisaanmsaioajkdjsa开双冲akjhjkfjaok返矿卡健康返矿桑吉很但恐韩克很检控方炯看就肯斯的就看妇科琅丹福斯翻看东街口翻开三即可"
58+
)]
59+
[HelpText("数据库连接字符串, 例如: \"Server=localhost;Port=3306;Database=test;Uid=root;Pwd=123456;\"")]
5860
[EnvironmentVariableAttribute("DATABASE_URL")]
5961
public string? DatabaseUrl { get; set; }
6062
}
@@ -77,7 +79,7 @@ public static void Run(string[] args)
7779
if (args.Length == 0)
7880
{
7981
Console.WriteLine("📝 使用默认测试参数...");
80-
args = new[] { "--app-name", "BasicDemo", "--host", "example.com", "--port", "9090", "--debug", "--log-level", "Debug" };
82+
args = new[] { "--app-name", "BasxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxicDemo", "--host", "examaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaple.com", "--port", "9090", "--debug", "--log-level", "Debug" };
8183
Console.WriteLine($" 参数: {string.Join(" ", args)}");
8284
Console.WriteLine();
8385
}

GameFrameX.Foundation.Tests/Options/Program.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@
44
//
55
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
66

7-
using System;
87
using GameFrameX.Foundation.Options.Examples.Demos;
98

10-
namespace GameFrameX.Foundation.Options.Examples
9+
namespace GameFrameX.Foundation.Tests.Options
1110
{
1211
/// <summary>
1312
/// GameFrameX Foundation Options 示例程序主入口
1413
/// </summary>
15-
class Program
14+
public static class ProgramOptions
1615
{
1716
/// <summary>
1817
/// 程序主入口点
1918
/// </summary>
2019
/// <param name="args">命令行参数</param>
21-
static void Entry(string[] args)
20+
public static void Entry(string[] args)
2221
{
2322
Console.WriteLine("╔══════════════════════════════════════════════════════════════╗");
2423
Console.WriteLine("║ GameFrameX Foundation Options 示例程序 ║");

0 commit comments

Comments
 (0)