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:
26
StarterNG.Tests/GamePathsTests.cs
Normal file
26
StarterNG.Tests/GamePathsTests.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using StarterNG.Infrastructure.Adapters;
|
||||
|
||||
namespace StarterNG.Tests;
|
||||
|
||||
public class GamePathsTests
|
||||
{
|
||||
[Fact]
|
||||
public void Wellknown_folders_hang_off_the_installation_root()
|
||||
{
|
||||
var paths = new GamePaths(Path.Combine("opt", "maszyna"));
|
||||
|
||||
Assert.Equal(Path.Combine("opt", "maszyna", "scenery"), paths.Scenery);
|
||||
Assert.Equal(Path.Combine("opt", "maszyna", "dynamic"), paths.Dynamic);
|
||||
Assert.Equal(Path.Combine("opt", "maszyna", "textures", "mini"), paths.MiniTextures);
|
||||
Assert.Equal(Path.Combine("opt", "maszyna", "starter", "bledy.txt"), paths.DiagnosticsLog);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FromRoot_joins_segments_below_the_root()
|
||||
{
|
||||
var paths = new GamePaths("game");
|
||||
|
||||
Assert.Equal(Path.Combine("game", "data", "load_weights.txt"),
|
||||
paths.FromRoot("data", "load_weights.txt"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user