26 lines
1.4 KiB
C#
26 lines
1.4 KiB
C#
using Launcher.Next.Core;
|
|
using Xunit;
|
|
|
|
namespace Launcher.Next.Tests;
|
|
|
|
public sealed class StartupRosterPreflightTests
|
|
{
|
|
[Fact]
|
|
public void ForeignVersionIsConflicting()
|
|
{
|
|
var root = Path.Combine(Path.GetTempPath(), "roster-" + Guid.NewGuid().ToString("N"));
|
|
var requestedRoot = Path.Combine(root, "requested");
|
|
Directory.CreateDirectory(requestedRoot);
|
|
File.WriteAllText(Path.Combine(requestedRoot, "PRecAnnot.Plant3D2026.dll"), "new");
|
|
var old = Path.Combine(root, "Applications", "P_Rec_Annot", "versions", "0.1.0");
|
|
Directory.CreateDirectory(old);
|
|
File.WriteAllText(Path.Combine(old, "PRecAnnot.Plant3D2026.dll"), "old");
|
|
File.WriteAllText(Path.Combine(root, "Applications", "P_Rec_Annot", "current.json"), "{\"Current\":\"0.1.0\"}");
|
|
File.WriteAllText(Path.Combine(old, "package.manifest.json"), "{\"PackageId\":\"P_Rec_Annot\",\"Version\":\"0.1.0\",\"EntryAssembly\":\"PRecAnnot.Plant3D2026.dll\"}");
|
|
var requested = new PackageManifest(1, "P_Rec_Annot", "0.2.9", "Plant3D", 2026, "x64", "PRecAnnot.Plant3D2026.dll", [], new("netload", "PHP_REC_ANNOT"));
|
|
var report = StartupRosterPreflight.Inspect(requestedRoot, requested, [Path.Combine(root, "Applications")]);
|
|
Assert.Equal(StartupRosterCandidateStatus.ConflictingCandidatePresent, report.Status);
|
|
Directory.Delete(root, true);
|
|
}
|
|
}
|