Closed italopessoa closed 1 month ago
The recent updates primarily focus on enhancing the ProductRepositoryDapper
by implementing the DeleteAsync
method to support actual product deletion and modifying the ProductRepositoryDapperTest
to handle product images more flexibly and to include tests for the new deletion functionality. These changes improve the robustness and functionality of the product management system.
File Path | Change Summary |
---|---|
.../Repository/ProductRepositoryDapper.cs | Updated DeleteAsync method to perform actual deletion asynchronously. |
.../Repository/ProductRepositoryDapperTest.cs | Modified image handling in Create_Success and added DeleteAsync_Success and DeleteAsync_Fail tests. |
src/FIAP.TechChallenge.ByteMeBurger.Infrastructure/Repository/ProductRepositoryDapper.cs (1)
Pattern `**/*.cs`: Validate all files and structures against Domain Driven Design principles and Ports & Adapters architecture pattern.tests/FIAP.TechChallenge.ByteMeBurger.Infrastructure.Test/Repository/ProductRepositoryDapperTest.cs (1)
Pattern `**/*.cs`: Validate all files and structures against Domain Driven Design principles and Ports & Adapters architecture pattern.
tests/FIAP.TechChallenge.ByteMeBurger.Infrastructure.Test/Repository/ProductRepositoryDapperTest.cs (3)
Line range hint `30-51`: Changes in the `Create_Success` method are correctly implemented. The modifications to handle product images as a list and the updated SQL command reflect the changes in the main repository code. The assertions are appropriately checking the results, ensuring the method behaves as expected. --- `55-68`: The `DeleteAsync_Success` method is well-implemented. The test correctly sets up the expected behavior using a mock and verifies that the deletion operation returns true, indicating that the deletion was successful. --- `70-83`: The `DeleteAsync_Fail` method correctly handles the failure scenario. This test method appropriately sets up a scenario where no rows are affected by the deletion operation, and it correctly asserts that the result should be false, indicating the operation did not succeed as expected.
4
it stills missing some validations to check whether the product exists or not