This repository has been archived by the owner on May 23, 2024. It is now read-only.
Pull Request: Workflow Updates, Code Refactoring, and Test Enhancements #1010
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes Made
Earlier
Workflow Updates in .github/workflows/dotnetcore.yml:
Reasoning: Upgraded GitHub Actions to the latest versions (v4) for checkout and .NET setup(V3).
Purpose: Ensure compatibility with the latest GitHub Actions features and improvements.
Specifics:
Replaced uses: actions/checkout@v2 with uses: actions/checkout@v4.
Updated uses: actions/setup-dotnet@v1 to uses: actions/setup-dotnet@v3.
Workflow Updates in .github/workflows/richnav.yml:
Reasoning: Aligned with changes in .github/workflows/dotnetcore.yml to maintain consistency.
Purpose: Ensure uniformity across workflows and utilize the latest GitHub Actions features.
Specifics:
Replaced uses: actions/checkout@v2 with uses: actions/checkout@v4.
Updated uses: actions/setup-dotnet@v1 to uses: actions/setup-dotnet@v3.
Code Refactoring in src/ApplicationCore/Exceptions/EmptyBasketOnCheckoutException.cs:
Reasoning: Removed an obsolete constructor to adhere to best practices and eliminate warnings.
Purpose: Enhance code maintainability and eliminate obsolete features.
Specifics:
Removed the obsolete constructor.
Refactored class structure for clarity.
Test Enhancement in tests/IntegrationTests/Repositories/BasketRepositoryTests/SetQuantities.cs:
Reasoning: Improved the test assertion for better readability and adherence to xUnit best practices.
Purpose: Enhance the expressiveness and clarity of the test.
Specifics:
Replaced Assert.Equal(0, basket.Items.Count) with Assert.Empty(basket.Items).
Test Enhancement in tests/UnitTests/ApplicationCore/Entities/BasketTests/BasketRemoveEmptyItems.cs:
Reasoning: Improved the test assertion for better readability and adherence to xUnit best practices.
Purpose: Enhance the expressiveness and clarity of the test.
Specifics:
Replaced Assert.Equal(0, basket.Items.Count) with Assert.Empty(basket.Items).
Test Adjustment in tests/UnitTests/ApplicationCore/Specifications/CustomerOrdersWithItemsSpecification.cs:
Reasoning: Improved test assertions for better readability and adherence to xUnit best practices.
Purpose: Enhance the expressiveness and clarity of the tests.
Specifics:
Replaced Assert.Equal(1, result.OrderItems.Count) with Assert.Single(result.OrderItems).
Replaced Assert.Equal(2, result.Count) with Assert.Equal(2, result[1].OrderItems.Count).
Simplified other assertions for improved readability.
These changes were made to improve workflow consistency, address warnings, enhance code readability, and adhere to best practices in test assertions.