Completed payment service implementation

This commit is contained in:
Khwezi Mngoma
2026-05-31 18:42:00 +02:00
parent 0e21ec283d
commit f88cc42a88
7 changed files with 600 additions and 1 deletions
@@ -9,6 +9,47 @@ public class ProductServiceFeatureTests(Fixture fixture, ITestOutputHelper outpu
{
private readonly ProductService productService = fixture.Services.GetRequiredService<ProductService>();
[IntegrationFact]
public async Task CheckProductStockAvailabilityAsync_ShouldReturn_ResultWithProductInventory()
{
var result = await productService.CheckProductStockAvailabilityAsync(1, 1, fixture.CancellationToken);
Assert.True(result.IsSuccess);
Assert.NotNull(result.Value);
}
[IntegrationFact]
public async Task ReserveProductInventoryAsync_ShouldReturn_ResultWithSuccess()
{
var request = new ReserveStock
{
ProductId = 1,
ProductPriceId = 1,
Reservation = 100,
};
var result = await productService.ReserveProductInventoryAsync(request, fixture.CancellationToken);
Assert.True(result.IsSuccess);
Assert.True(result.Value > 0);
}
[IntegrationFact]
public async Task AllocateProductInventoryAsync_ShouldReturn_ResultWithSuccess()
{
var request = new AllocateStock
{
ProductId = 1,
ProductPriceId = 1,
Allocation = 500,
};
var result = await productService.AllocateProductInventoryAsync(request, fixture.CancellationToken);
Assert.True(result.IsSuccess);
Assert.True(result.Value > 0);
}
[IntegrationFact]
public async Task AddProductCategoryAsync_ShouldReturn_ResultWithId()
{