Exercise-Repository as part of the iOS Lead Essentials Training
Story: Customer requests to see their image feed
As an online customer
I want the app to atuomatically load my latest image feed
So I can always enjoy the latest images of my friends
Scenarios (Acceptance criteria):
Given the customer has connectivity
When the customer requests to see their feed
Then the app should display the latest feed from remote
And replace the cache with the new feed
As an offline customer
I want the app to show the latest saved version of my feed
So I can always enjoy images of my friends
Scenarios (Acceptance criteria):
Given the customer doesn't have connectivity
And there is a cached version of the feed
And the cache is less than seven days old
When the customer requests their feed
Then the app should display the latest feed saved
Given the customer doesn't have connectivity
And there is a cached version of the feed
And the cache is seven days old or more
When the customer requests their feed
Then the app should display an error message
Given the customer doesn't have connectivity
And the cache is empty
When the customer requests their feed
Then the app should display an error message
Data: - URL
Primary Course (happy path):
- Execute "Load Image Feed" command with above data
- System downloads data from URL
- System validates downloaded data
- System creates image feed from valid data
- System delivers image feed
Invalid data - error course (sad path):
- System delivers invalid data error
No connectivity - error course (sad path):
- System delivers connectivity error
- URL
- Execute "Load Image Data" command with above data.
- System downloads data from the URL.
- System validates downloaded data.
- System delivers image data.
- System does not deliver image data nor error.
- System delivers invalid data error.
- System delivers connectivity error.
Primary Course (happy path):
- Execute "Load Image Feed" command with above data
- System retrieves feed data from cache
- System validates cache is less than seven days old
- System creates image feed from cached data
- System delivers image feed
Retrieval Error course (sad path):
- System delivers error
Expired cache - course (sad path):
- System delivers no image feed
Empty cache - course (sad path):
- System delivers no image feed
- URL
- Execute "Load Image Data" command with above data.
- System retrieves data from the cache.
- System delivers cached image data.
- System does not deliver image data nor error.
- System delivers error.
- System delivers not found error.
Primary Course (happy path):
- Execute "Validate Cache" command with above data
- System retrieves feed data from cache
- System validates cache is less than seven days old
Retrieval Error course (sad path):
- System deletes cache
Expired cache - course (sad path):
- System deletes cache
Empty cache - course (sad path):
- System delivers no image feed
Data: - Image Feed
Primary Course (happy path):
- Execute "Save Image Feed" command with above data
- System deletes old cached data
- System encodes new image feed
- System timestamps new cache
- System saves new cache data
- System delivers success message
Deleting - error course (sad path):
- System deletes cache
- System delivers error
Saving - error course (sad path):
- System delivers error