test(launcher): Campaign LA enforce composer-host contract
This commit is contained in:
parent
7749545dc4
commit
8a03a25fc3
6 changed files with 155 additions and 0 deletions
|
|
@ -0,0 +1,58 @@
|
|||
using AcDream.Launcher.Core.Launching;
|
||||
using AcDream.Launcher.Core.Profiles;
|
||||
using AcDream.Platform;
|
||||
|
||||
namespace AcDream.Tests.Fixtures.CampaignLa;
|
||||
|
||||
/// <summary>
|
||||
/// Produces one real Launcher.Core session document that is compiled into
|
||||
/// both host test suites. Keeping composition in one linked fixture makes the
|
||||
/// LA1/LA3 anti-drift gate prove that App and Headless accept the identical
|
||||
/// composer output rather than two hand-maintained lookalikes.
|
||||
/// </summary>
|
||||
internal static class LauncherCoreSessionConfigFixture
|
||||
{
|
||||
internal const string Password = "must-not-be-serialized";
|
||||
|
||||
internal static string Compose()
|
||||
{
|
||||
var server = new ServerProfile
|
||||
{
|
||||
Name = "Composer Server",
|
||||
Host = "composer.example",
|
||||
Port = 9010,
|
||||
};
|
||||
var account = new AccountProfile
|
||||
{
|
||||
Account = "composer-account",
|
||||
Password = Password,
|
||||
};
|
||||
var character = new CharacterProfile
|
||||
{
|
||||
Name = "Composer Character",
|
||||
Id = "0x50000001",
|
||||
LaunchMode = LaunchMode.Headless,
|
||||
Plugins = ["ComposerPlugin"],
|
||||
LoginCommands = ["/composer command"],
|
||||
};
|
||||
var install = new LauncherInstallRecord(
|
||||
"composer-dats",
|
||||
"composer-dats/acdream.pak");
|
||||
var paths = new ApplicationPathSet(
|
||||
Path.Combine(Path.GetTempPath(), "composer-config"),
|
||||
Path.Combine(Path.GetTempPath(), "composer-data"),
|
||||
Path.Combine(Path.GetTempPath(), "composer-cache"),
|
||||
LegacyConfigDirectory: null);
|
||||
|
||||
ComposedSessionConfig composed = SessionConfigComposer.Compose(
|
||||
server,
|
||||
account,
|
||||
character,
|
||||
install,
|
||||
paths,
|
||||
"composer-contract",
|
||||
loginCommandDelayMs: 625);
|
||||
|
||||
return SessionConfigComposer.Serialize(composed.Document);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue