- WHY: establish Stage 3 task-001 execution baseline per repo intent - WHAT: add minimal solution/project skeleton and boundary docs - RULE: apply stage3 execution runtime and repository workflow directives
29 lines
942 B
C#
29 lines
942 B
C#
using Thalos.Service.Application.Ports;
|
|
using Thalos.Service.Application.UseCases;
|
|
using Thalos.Service.Identity.Abstractions.Contracts;
|
|
|
|
namespace Thalos.Service.Application.UnitTests;
|
|
|
|
public class IssueIdentityTokenUseCaseTests
|
|
{
|
|
[Fact]
|
|
public async Task HandleAsync_WhenCalled_DelegatesToReadPort()
|
|
{
|
|
var port = new FakeIdentityTokenReadPort();
|
|
var useCase = new IssueIdentityTokenUseCase(port);
|
|
|
|
var response = await useCase.HandleAsync(new IssueIdentityTokenRequest("user-1", "tenant-1"));
|
|
|
|
Assert.Equal("token-123", response.Token);
|
|
Assert.Equal(3600, response.ExpiresInSeconds);
|
|
}
|
|
|
|
private sealed class FakeIdentityTokenReadPort : IIdentityTokenReadPort
|
|
{
|
|
public Task<IssueIdentityTokenResponse> IssueTokenAsync(IssueIdentityTokenRequest request)
|
|
{
|
|
return Task.FromResult(new IssueIdentityTokenResponse("token-123", 3600));
|
|
}
|
|
}
|
|
}
|