Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Improve code readability and modularity by introducing constants, decomposing conditions, and refactoring test logic #105

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

Conversation

malav2310
Copy link

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.

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

Successfully merging this pull request may close these issues.

1 participant