Files
StarterNG/StarterNG.Tests/InstallationCheckTests.cs
maj00r 3c502f630d Split Settings into model, serializer, paths and store
698 lines did all of it at once. The mutable CaptureFromUi callback becomes an
ISettingsCapture the settings view implements.
2026-09-04 21:13:06 +02:00

44 lines
1.7 KiB
C#

using StarterNG.Infrastructure;
using StarterNG.Infrastructure.Adapters;
using StarterNG.Tests.Fakes;
namespace StarterNG.Tests;
public class InstallationCheckTests
{
[Fact]
public void An_empty_folder_reports_every_missing_game_directory()
{
var installation = new TestInstallation();
var strings = installation.Strings.With("FaultNoDir", "missing {0}");
var check = new InstallationCheck(installation.Paths, installation.Files, strings,
installation.Physics, installation.Library, installation.SettingsStore);
var faults = check.Run();
Assert.Contains("missing /dynamic", faults);
Assert.Contains("missing /scenery", faults);
Assert.Contains("FaultNoWeights", faults);
}
[Fact]
public void A_complete_installation_reports_no_missing_directories()
{
var files = new InMemoryFileSystem()
.WithDirectory(Path.Combine("game", "dynamic"))
.WithDirectory(Path.Combine("game", "sounds"))
.WithDirectory(Path.Combine("game", "models"))
.WithDirectory(Path.Combine("game", "scenery"))
.WithDirectory(Path.Combine("game", "textures"))
.WithFile(Path.Combine("game", "data", "load_weights.txt"), "");
var installation = new TestInstallation(files);
var strings = installation.Strings.With("FaultNoDir", "missing {0}");
var faults = new InstallationCheck(installation.Paths, files, strings,
installation.Physics, installation.Library, installation.SettingsStore).Run();
Assert.DoesNotContain(faults, fault => fault.StartsWith("missing "));
Assert.DoesNotContain("FaultNoWeights", faults);
}
}