Closed keefertaylor closed 4 years ago
Merging #238 into master will increase coverage by
1.22%
. The diff coverage is92.75%
.
@@ Coverage Diff @@
## master #238 +/- ##
==========================================
+ Coverage 88.03% 89.26% +1.22%
==========================================
Files 42 42
Lines 861 941 +80
==========================================
+ Hits 758 840 +82
+ Misses 103 101 -2
Impacted Files | Coverage Δ | |
---|---|---|
XpringKit/PayID/XRPPayIDClient.swift | 85.00% <82.60%> (+3.18%) |
:arrow_up: |
XpringKit/PayID/PayIDClient.swift | 91.95% <91.30%> (+10.70%) |
:arrow_up: |
XpringKit/XRP/DefaultXRPClient.swift | 98.60% <100.00%> (+1.43%) |
:arrow_up: |
...XRP/Model/XRPPayment+Org_Xrpl_Rpc_V1_Payment.swift | 100.00% <100.00%> (ø) |
|
...l/XRPTransaction+Org_Xrpl_Rpc_V1_Transaction.swift | 96.00% <100.00%> (+0.44%) |
:arrow_up: |
XpringKit/XRP/ReliableSubmissionXRPClient.swift | 94.23% <100.00%> (+0.11%) |
:arrow_up: |
XpringKit/XRP/XRPClient.swift | 100.00% <100.00%> (ø) |
|
XpringKit/Xpring/XpringClient.swift | 100.00% <100.00%> (+5.55%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 067f7bb...92f2d25. Read the comment docs.
High Level Overview of Change
Add testing infrastructure for PayID.
Context of Change
Previous versions of Swagger were untestable. #227 migrated to a new generator which has testable code.
This PR does a few things:
SessionManager
intoPayIDClient
in the initializerFakeURLProtocol
so that we can fake networkingThe faking code is heavily adapted from this blog post: https://www.google.com/search?q=alamofire+fake&oq=alamofire+fake&aqs=chrome..69i57.2366j0j1&sourceid=chrome&ie=UTF-8.
Since it is mostly boiler plate and it's only test code, I didn't do much in the way of documentation or stylistic updating.
Type of Change
Before / After
Better test coverage.
Test Plan
New test passes on CI.
Future Tasks
We should continue building tests for PayID. They are omitted here for brevity of this PR. Once the testing infrastructure exists it is trivial to write additional test cases.