feat(D.2b): RuntimeOptions.RetailUi + AcDir toggles
Adds two startup-time env toggles that Phase D.2b's retail-UI panel frame will read: - ACDREAM_RETAIL_UI=1 → opts.RetailUi (bool, default false) - ACDREAM_AC_DIR=<path> → opts.AcDir (string?, default null) Both follow the existing helper conventions (IsExactlyOne / NullIfEmpty). No call sites broke because the only construction site in RuntimeOptions.cs already uses named arguments. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
35152248f1
commit
626d06ebc1
2 changed files with 34 additions and 2 deletions
28
tests/AcDream.App.Tests/RuntimeOptionsRetailUiTests.cs
Normal file
28
tests/AcDream.App.Tests/RuntimeOptionsRetailUiTests.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using System.Collections.Generic;
|
||||
using AcDream.App;
|
||||
|
||||
namespace AcDream.App.Tests;
|
||||
|
||||
public class RuntimeOptionsRetailUiTests
|
||||
{
|
||||
[Fact]
|
||||
public void Parse_ReadsRetailUiAndAcDir()
|
||||
{
|
||||
var env = new Dictionary<string, string?>
|
||||
{
|
||||
["ACDREAM_RETAIL_UI"] = "1",
|
||||
["ACDREAM_AC_DIR"] = @"C:\Turbine\Asheron's Call",
|
||||
};
|
||||
var opts = RuntimeOptions.Parse("dats", k => env.GetValueOrDefault(k));
|
||||
Assert.True(opts.RetailUi);
|
||||
Assert.Equal(@"C:\Turbine\Asheron's Call", opts.AcDir);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Parse_DefaultsRetailUiOffAndAcDirNull()
|
||||
{
|
||||
var opts = RuntimeOptions.Parse("dats", _ => null);
|
||||
Assert.False(opts.RetailUi);
|
||||
Assert.Null(opts.AcDir);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue