Refactor: Improve code readability and modularity by introducing constants, decomposing conditions, and refactoring test logic #105
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.
This pull request includes a series of refactorings to improve code readability and modularity. The changes are as follows:
Introduce MAX_EPISODE_ID_ALLOWED constant:
Replaced the magic number with a named constant MAX_EPISODE_ID_ALLOWED to improve code clarity and provide better context on its purpose.
Decompose complex conditional into static methods:
Simplified the complex if-else condition in Playlist logic by creating two static methods to handle null checks for input parameters, enhancing code readability and maintainability.
Rename variable to maxEpisodeIds:
Renamed the variable to maxEpisodeIds for better readability, making it clearer and more aligned with naming conventions.
Refactor ResponseChecker to handle different HTTP response codes:
Updated the ResponseChecker class to handle various HTTP response codes more effectively, including 200, 400, 401, and 500. This provides better error handling and cleaner response management.
Move player device and context API testing logic to separate classes:
Extracted the player device and context API testing logic into dedicated classes to improve test structure and maintainability.
Introduce abstract class for shared player service tests:
Added an abstract class for shared player service tests, with specific concrete test classes for each player service type. This reduces code duplication and improves test organization.