This repository was archived by the owner on Jan 13, 2025. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork5.8k
Pull Request: Workflow Updates, Code Refactoring, and Test Enhancements#1010
Open
SilentSobs wants to merge10 commits intodotnet-architecture:mainChoose a base branch fromSilentSobs:workflow-update
base:main
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
@dotnet-policy-service agree |
Assert.NotNull(result[0].OrderItems.FirstOrDefault()?.ItemOrdered); | ||
Assert.Equal(2, result[1].OrderItems.Count); |
Contributor
SrushtiPasari94Feb 14, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@SilentSobs This test is checking count in the result not the no. of results
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Ok .
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
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.