- 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
975 B
C#
29 lines
975 B
C#
using Furniture.Service.Application.Ports;
|
|
using Furniture.Service.Application.UseCases;
|
|
using Furniture.Service.Contracts.UseCases;
|
|
|
|
namespace Furniture.Service.Application.UnitTests;
|
|
|
|
public class GetFurnitureAvailabilityUseCaseTests
|
|
{
|
|
[Fact]
|
|
public async Task HandleAsync_WhenCalled_DelegatesToReadPort()
|
|
{
|
|
var port = new FakeFurnitureAvailabilityReadPort();
|
|
var useCase = new GetFurnitureAvailabilityUseCase(port);
|
|
|
|
var response = await useCase.HandleAsync(new GetFurnitureAvailabilityRequest("FUR-001"));
|
|
|
|
Assert.Equal("FUR-001", response.FurnitureId);
|
|
Assert.Equal(10, response.QuantityAvailable);
|
|
}
|
|
|
|
private sealed class FakeFurnitureAvailabilityReadPort : IFurnitureAvailabilityReadPort
|
|
{
|
|
public Task<GetFurnitureAvailabilityResponse> GetAvailabilityAsync(string furnitureId)
|
|
{
|
|
return Task.FromResult(new GetFurnitureAvailabilityResponse(furnitureId, 10));
|
|
}
|
|
}
|
|
}
|