mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-10-16 23:49:19 +02:00
Introduce layers, ports and a composition root
Ports in Application/Abstractions, adapters in Infrastructure, hand-wired AppServices (no reflection, as PublishAot requires). Adds a test project.
This commit is contained in:
39
StarterNG.Tests/InstallationCheckTests.cs
Normal file
39
StarterNG.Tests/InstallationCheckTests.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
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 strings = new FakeStrings().With("FaultNoDir", "missing {0}");
|
||||
var check = new InstallationCheck(new GamePaths("game"), new InMemoryFileSystem(), strings);
|
||||
|
||||
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 strings = new FakeStrings().With("FaultNoDir", "missing {0}");
|
||||
|
||||
var faults = new InstallationCheck(new GamePaths("game"), files, strings).Run();
|
||||
|
||||
Assert.DoesNotContain(faults, fault => fault.StartsWith("missing "));
|
||||
Assert.DoesNotContain("FaultNoWeights", faults);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user