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/Fakes/FakeStrings.cs
Normal file
26
StarterNG.Tests/Fakes/FakeStrings.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using StarterNG.Application.Abstractions;
|
||||
|
||||
namespace StarterNG.Tests.Fakes;
|
||||
|
||||
/// <summary>
|
||||
/// Translation table that echoes keys back, so assertions can name the key that
|
||||
/// a screen or check would have shown.
|
||||
/// </summary>
|
||||
public sealed class FakeStrings : ILocalizedStrings
|
||||
{
|
||||
private readonly Dictionary<string, string> _overrides = new(StringComparer.Ordinal);
|
||||
|
||||
public string this[string key] => _overrides.TryGetValue(key, out var value) ? value : key;
|
||||
|
||||
public string Opt(string key) => _overrides.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
|
||||
public string CurrentLanguage => "English";
|
||||
|
||||
public string CurrentLangCode => "en";
|
||||
|
||||
public FakeStrings With(string key, string value)
|
||||
{
|
||||
_overrides[key] = value;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user