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>
28 lines
763 B
C#
28 lines
763 B
C#
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);
|
|
}
|
|
}
|