tests: add mucho tests

This commit is contained in:
Stevan Freeborn
2026-02-06 06:53:20 -06:00
parent b2086d8185
commit 5b1a5f003e
26 changed files with 1983 additions and 18 deletions
@@ -16,6 +16,8 @@ public class TestApi : WebApplicationFactory<Program>
}));
c.AddSingleton(Options.Create(JwtTokenBuilder.DefaultJwtOptions));
c.AddSingleton<IKeyRing>(TestKeyRing.From);
});
}
}
@@ -0,0 +1,31 @@
namespace FiscalOS.API.Tests.Infra;
internal sealed class TestKeyRing : IKeyRing
{
private readonly string _key = Convert.ToBase64String(RandomNumberGenerator.GetBytes(32));
private TestKeyRing()
{
}
public static TestKeyRing From(IServiceProvider serviceProvider)
{
return new();
}
public KeyRingEntry GetKey(string keyId)
{
return KeyRingEntry.From(keyId, _key);
}
public KeyRingEntry GetPrimaryKey()
{
return KeyRingEntry.From("primary-key-id", _key);
}
public Task<KeyRingEntry> SaveKeyAsync(string key)
{
throw new NotImplementedException();
}
}