Tests for RealmService.FindBySlug
This commit is contained in:
parent
7a5cb703ec
commit
a80c133e2a
3 changed files with 49 additions and 16 deletions
|
|
@ -3,6 +3,7 @@ using IdentityShroud.Core.Contracts;
|
|||
using IdentityShroud.Core.Helpers;
|
||||
using IdentityShroud.Core.Messages.Realm;
|
||||
using IdentityShroud.Core.Model;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace IdentityShroud.Core.Services;
|
||||
|
||||
|
|
@ -12,9 +13,9 @@ public class RealmService(
|
|||
Db db,
|
||||
IEncryptionService encryptionService) : IRealmService
|
||||
{
|
||||
public Task<Realm?> FindBySlug(string slug, CancellationToken ct = default)
|
||||
public async Task<Realm?> FindBySlug(string slug, CancellationToken ct = default)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return await db.Realms.SingleOrDefaultAsync(r => r.Slug == slug, ct);
|
||||
}
|
||||
|
||||
public async Task<Result<RealmCreateResponse>> Create(RealmCreateRequest request, CancellationToken ct = default)
|
||||
|
|
@ -26,8 +27,6 @@ public class RealmService(
|
|||
Name = request.Name,
|
||||
Keys = [ CreateKey() ],
|
||||
};
|
||||
|
||||
|
||||
|
||||
db.Add(realm);
|
||||
await db.SaveChangesAsync(ct);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue