thalos-service/tests/Thalos.Service.Application.UnitTests/IssueIdentityTokenUseCaseTests.cs
José René White Enciso 9f1790ef11 feat(stage3): scaffold task-001 baseline
- 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
2026-02-22 01:30:02 -06:00

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));
}
}
}