46 lines
1.4 KiB
C#
46 lines
1.4 KiB
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);
|
|
}
|
|
|
|
[Fact]
|
|
public void Parse_ReadsUiProbeOptions()
|
|
{
|
|
var env = new Dictionary<string, string?>
|
|
{
|
|
["ACDREAM_UI_PROBE_DUMP"] = "1",
|
|
["ACDREAM_UI_PROBE_SCRIPT"] = @"C:\tmp\ui-probe.txt",
|
|
["ACDREAM_AUTOMATION_ARTIFACT_DIR"] = @"C:\tmp\world-gate",
|
|
};
|
|
|
|
var opts = RuntimeOptions.Parse("dats", k => env.GetValueOrDefault(k));
|
|
|
|
Assert.True(opts.UiProbeDump);
|
|
Assert.Equal(@"C:\tmp\ui-probe.txt", opts.UiProbeScript);
|
|
Assert.Equal(@"C:\tmp\world-gate", opts.AutomationArtifactDirectory);
|
|
Assert.True(opts.UiProbeEnabled);
|
|
}
|
|
}
|