mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-05 13:24:51 +01:00
Write settings, presets and favourites whole or not at all
A failed write leaves the old file in place. Settings that could not be read are not saved over. UI exceptions reach the log. Started from a shortcut set up elsewhere, the starter moves to its own folder when only that one holds a game.
This commit is contained in:
12
StarterNG.Tests/Fakes/TestLog.cs
Normal file
12
StarterNG.Tests/Fakes/TestLog.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using StarterNG.Application.Abstractions;
|
||||
using StarterNG.Infrastructure.Adapters;
|
||||
|
||||
namespace StarterNG.Tests.Fakes;
|
||||
|
||||
/// <summary>The diagnostics log for a test that only wants one to write to or read back.</summary>
|
||||
public static class TestLog
|
||||
{
|
||||
/// <param name="files">Where the log file goes; a disk of its own when left out.</param>
|
||||
public static FileDiagnosticsLog Over(IFileSystem? files = null) =>
|
||||
new(files ?? new InMemoryFileSystem(), new FixedClock(new DateTime(2026, 10, 13)), new GamePaths("game"));
|
||||
}
|
||||
Reference in New Issue
Block a user