Tests voor client api and service
This commit is contained in:
parent
cd2ec646fd
commit
3d73a9914c
12 changed files with 267 additions and 30 deletions
|
|
@ -1,14 +1,14 @@
|
|||
using FluentResults;
|
||||
using IdentityShroud.Api.Mappers;
|
||||
using IdentityShroud.Core.Contracts;
|
||||
using IdentityShroud.Core.Messages.Realm;
|
||||
using IdentityShroud.Core.Model;
|
||||
using IdentityShroud.Core.Services;
|
||||
using Microsoft.AspNetCore.Http.HttpResults;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace IdentityShroud.Api;
|
||||
|
||||
|
||||
|
||||
public record ClientCreateReponse(int Id, string ClientId);
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -34,13 +34,18 @@ public static class ClientApi
|
|||
.WithName(ClientGetRouteName);
|
||||
}
|
||||
|
||||
private static Task ClientGet(HttpContext context)
|
||||
private static Ok<ClientRepresentation> ClientGet(
|
||||
Guid realmId,
|
||||
int clientId,
|
||||
HttpContext context)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
Client client = (Client)context.Items["ClientEntity"]!;
|
||||
return TypedResults.Ok(new ClientMapper().ToDto(client));
|
||||
}
|
||||
|
||||
private static async Task<Results<CreatedAtRoute<ClientCreateReponse>, InternalServerError>>
|
||||
ClientCreate(
|
||||
Guid realmId,
|
||||
ClientCreateRequest request,
|
||||
[FromServices] IClientService service,
|
||||
HttpContext context,
|
||||
|
|
@ -64,6 +69,5 @@ public static class ClientApi
|
|||
["realmId"] = realm.Id,
|
||||
["clientId"] = client.Id,
|
||||
});
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue