Added product categories
continuous-integration/drone/pr Build is passing

This commit is contained in:
Khwezi Mngoma
2026-05-30 15:35:35 +02:00
parent e40c958066
commit 18d1640808
16 changed files with 1318 additions and 39 deletions
@@ -62,7 +62,7 @@ public class CategoryServiceFeatureTests(Fixture fixture) : IClassFixture<Fixtur
[IntegrationFact]
public async Task CreateCategoryAsync_ShouldReturn_ResultWithCategoryId()
{
var result = await categoryService.CreateCategoryAsync("Test", false, fixture.CancellationToken);
var result = await categoryService.CreateCategoryAsync("Test", true, fixture.CancellationToken);
Assert.True(result.IsSuccess);
Assert.True(result.Value > 0);
@@ -10,7 +10,40 @@ public class ProductServiceFeatureTests(Fixture fixture, ITestOutputHelper outpu
private readonly ProductService productService = fixture.Services.GetRequiredService<ProductService>();
[IntegrationFact]
public async Task GetProductPriceAsync_ShouldReturn_RetultOneProductPrice()
public async Task AddProductCategoryAsync_ShouldReturn_ResultWithId()
{
var result = await productService.AddProductCategoryAsync(1, 2, fixture.CancellationToken);
Assert.True(result.IsSuccess);
}
[IntegrationFact]
public async Task GetProductCategoriesAsync_ShouldReturn_ResultWithCategoryList()
{
var result = await productService.GetProductCategoriesAsync(1, fixture.CancellationToken);
Assert.True(result.IsSuccess);
Assert.NotEmpty(result.Value);
}
[IntegrationFact]
public async Task DeleteProductCategoryAsync_ShouldReturn_ResultWithSuccess()
{
var result = await productService.DeleteProductCategoryAsync(1, 1, fixture.CancellationToken);
Assert.True(result.IsSuccess);
}
[IntegrationFact]
public async Task DeleteAllProductCategoriesAsync_ShouldReturn_ResultWithSuccess()
{
var result = await productService.DeleteAllProductCategoriesAsync(1, fixture.CancellationToken);
Assert.True(result.IsSuccess);
}
[IntegrationFact]
public async Task GetProductPriceAsync_ShouldReturn_ResultOneProductPrice()
{
var result = await productService.GetProductPriceAsync(2, fixture.CancellationToken);
@@ -21,7 +54,7 @@ public class ProductServiceFeatureTests(Fixture fixture, ITestOutputHelper outpu
}
[IntegrationFact]
public async Task GetProductPricesAsync_ShouldReturn_RetultProductPriceList()
public async Task GetProductPricesAsync_ShouldReturn_ResultProductPriceList()
{
var result = await productService.GetProductPricesAsync(2, fixture.CancellationToken);
@@ -32,7 +65,7 @@ public class ProductServiceFeatureTests(Fixture fixture, ITestOutputHelper outpu
}
[IntegrationFact]
public async Task SearchProductsAsync_ShouldReturn_RetultMatchingProducts()
public async Task SearchProductsAsync_ShouldReturn_ResultMatchingProducts()
{
var filter = new ProductFilter
{
@@ -52,7 +85,7 @@ public class ProductServiceFeatureTests(Fixture fixture, ITestOutputHelper outpu
}
[IntegrationFact]
public async Task GetProductAsync_ShouldReturn_RetultOneProduct()
public async Task GetProductAsync_ShouldReturn_ResultOneProduct()
{
var result = await productService.GetProductAsync(2, fixture.CancellationToken);
@@ -63,7 +96,7 @@ public class ProductServiceFeatureTests(Fixture fixture, ITestOutputHelper outpu
}
[IntegrationFact]
public async Task GetProductsAsync_ShouldReturn_RetultProducts()
public async Task GetProductsAsync_ShouldReturn_ResultProducts()
{
var range = new DateRange
{
@@ -81,7 +114,7 @@ public class ProductServiceFeatureTests(Fixture fixture, ITestOutputHelper outpu
}
[IntegrationFact]
public async Task UpdateProductStatusAsync_ShouldReturn_ResultTrue()
public async Task UpdateProductStatusAsync_ShouldResurn_ResultTrue()
{
var result = await productService.UpdateProductStatusAsync(2, true, fixture.CancellationToken);