Completed payment service implementation
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user