Changes for proposal "Mocking Centrifuge Client for Testing Without a Server" #113
+463
−85
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.
Pull Request Description
This Pull Request introduces changes aimed at improving the testability and flexibility of the Centrifuge client for iOS, written in Swift. The main focus is on introducing protocols for key entities and optimizing their usage. Additional information is here Proposal: Mocking Centrifuge Client for Testing Without a Server
Key Changes:
Protocols for Core Classes:
Client
protocol for theCentrifugeClient
class.ClientSubscription
protocol for theCentrifugeSubscription
class.Integration Example Updates:
CentrifugeClient
andCentrifugeSubscription
classes in the integration example with their correspondingClient
andClientSubscription
protocols.Public Initializers for Models:
Property Optimization:
var
tolet
.Demonstration of Protocol Usage:
Suggestions for Future Improvements:
Notes:
All changes have been made with backward compatibility in mind. The existing logic of the client and subscriptions remains unchanged. This Pull Request simplifies Centrifuge integration into client projects and makes testing easier.
Demo project:
changes.demo.mp4