Closed italopessoa closed 1 month ago
The recent updates across various components of the ByteMeBurger project mainly enhance functionalities related to product handling and testing. New methods for setting product images and querying products by category have been introduced, alongside improvements in testing strategies with the use of AutoFixture for object creation. Additionally, a specific method in the order repository has been updated with a detailed justification for exclusion from code coverage due to current testing limitations.
File Path | Changes |
---|---|
.../Entities/Product.cs |
Added public Product() constructor and public void SetImages(string[] images) method. |
.../Repository/OrderRepositoryDapper.cs |
Updated code coverage exclusion justification for GetAllAsync() . |
.../Repository/ProductRepositoryDapper.cs |
Enhanced FindByCategory with logic for querying and setting images. |
tests/.../Controllers/ProductControllerTest.cs tests/.../Services/ProductServiceTest.cs |
Imported AutoFixture.Kernel namespace; refactored product creation using ProductGenerator . |
tests/.../Repository/ProductRepositoryDapperTest.cs |
Improved readability in _mockConnection setup; added FindByIdAsync_NotImplemented() test method. |
build success (10)
src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Product.cs: [warning] 22-22: Non-nullable property 'Name' must contain a non-null value when exiting constructor. Consider declaring the property as nullable. --- src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Product.cs: [warning] 22-22: Non-nullable property 'Description' must contain a non-null value when exiting constructor. Consider declaring the property as nullable. --- src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Product.cs: [warning] 22-22: Non-nullable property 'Images' must contain a non-null value when exiting constructor. Consider declaring the property as nullable. --- src/FIAP.TechChallenge.ByteMeBurger.Infrastructure/Repository/OrderRepositoryDapper.cs: [warning] 41-41: The variable 'e' is declared but never used
src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Product.cs (1)
Pattern `**/*.cs`: Validate all files and structures against Domain Driven Design principles and Ports & Adapters architecture pattern.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.src/FIAP.TechChallenge.ByteMeBurger.Infrastructure/Repository/OrderRepositoryDapper.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.Application.Test/Services/ProductServiceTest.cs (1)
Pattern `**/*.cs`: Validate all files and structures against Domain Driven Design principles and Ports & Adapters architecture pattern.tests/FIAP.TechChallenge.ByteMeBurger.Api.Test/Controllers/ProductControllerTest.cs (1)
Pattern `**/*.cs`: Validate all files and structures against Domain Driven Design principles and Ports & Adapters architecture pattern.
src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Product.cs (1)
`49-54`: Ensure that direct state modification by `SetImages` aligns with the overall design philosophy of your domain models. Consider using immutable objects if state changes need to be tracked or undone.src/FIAP.TechChallenge.ByteMeBurger.Infrastructure/Repository/ProductRepositoryDapper.cs (1)
`53-63`: The implementation of `FindByCategory` looks correct. However, consider adding a detailed comment explaining the reason behind excluding this method from code coverage, ensuring it's revisited when the testing framework limitations are resolved.src/FIAP.TechChallenge.ByteMeBurger.Infrastructure/Repository/OrderRepositoryDapper.cs (1)
`58-58`: Ensure that the exclusion from code coverage for `GetAsync` is well-documented and tracked for future resolution when the testing framework limitations are addressed.tests/FIAP.TechChallenge.ByteMeBurger.Infrastructure.Test/Repository/ProductRepositoryDapperTest.cs (2)
`60-61`: The setup for the `DeleteAsync` success test is correctly implemented. --- `76-77`: The setup for the `DeleteAsync` failure test is correctly implemented.tests/FIAP.TechChallenge.ByteMeBurger.Application.Test/Services/ProductServiceTest.cs (1)
Line range hint `177-265`: The use of `AutoFixture` in tests is well-implemented, enhancing the setup process. Consider adding comments explaining why `AutoFixture` was chosen and how it benefits your testing strategy.tests/FIAP.TechChallenge.ByteMeBurger.Api.Test/Controllers/ProductControllerTest.cs (1)
Line range hint `36-356`: The tests in `ProductControllerTest` are comprehensive and effectively cover the functionality of the `ProductController`. The use of `AutoFixture` is consistent and aids in simplifying the setup of test data. Consider adding more detailed comments on the use of `AutoFixture` to aid future maintainers.
6