Skip to content
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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

SilentSobs
Copy link

Changes Made

Earlier

Earlier Build

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.

@SilentSobs
Copy link
Author

@dotnet-policy-service agree

Assert.NotNull(result[0].OrderItems.FirstOrDefault()?.ItemOrdered);
Assert.Equal(2, result[1].OrderItems.Count);
Copy link
Contributor

@SrushtiPasari94 SrushtiPasari94 Feb 14, 2024

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants