Rates
A currency rate converter App.
API
This App uses api from Currency Layer, Please check their Documentation for more information.
SETUP
To configure the API, inside the Info.plist, under CurrencyLayer
,
replace #YOUR_API_KEY
with your actual APIkey
.
Example:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
...
<key>CurrencyLayer</key>
<dict>
<key>APIKey</key>
<string>#YOUR_API_KEY</string>
</dict>
</dict>
</plist>
Unit Testing
This project uses the concept of mocking the request to avoid the hitting the server while still using the actual API
request calls. All requests from the APIService are all hijacked and replaced with the mock ones.
You can see all the response of the hijacked request can be found on mock-resources/api for more info. The Path
and File
under mock-resources folder represents the Actual Endpoint
of the Request
Example:
endpoint: /api/list
- mock-resources:
- api:
- list:
I'm planning to improve this by having a
Code Convention
for writtingHTTP Response
like adding customResponse Headers
, react to diffrentHTTPMethod
andQuery Params
, make itpluggable
and easy to use. Please check this Hijackr for more info in the Future.
Please see the RatesTests target for more info.
Test results can also be viewed from Travis CI - Rates
Notes
-
The App will only execute the actual
refresh
only after 30 minutes from the last successful request to avoid reaching the rate limitation of the API. -
Due to the limitation of the
Free API Key
from Currency Layer, switching theBase Currency
other thanUSD
will alert an Error message like:Access Restricted. Your current Subscription plan does not support Source Currency Switching.
And to solve this issue, you have to subscribed to their Paid Service.
TODO
- [ ] Test cases for Failed request.
- [ ] Localization
- [ ] Empty State for List
- [ ] Custom Keyboard Input
- [ ] UI Test cases
- [ ] Additional tests for different iOS and Device version.
- [ ] Reacheability.