Story: Customer requests to see popular movies list
Narrative #1
As an online customer
I want the app to automatically load the recent popular movies
So I can always enjoy the newest popular movies
Scenarios (Acceptance criteria)
Given the customer has connectivity
When the customer requests to see the popular movies
Then the app should display the latest popular movies from remote
And replace the cache with the new popular movies
Narrative #2
As an offline customer
I want the app to show the latest saved version of popular movies
So I can always enjoy the newest saved popular movies
Scenarios (Acceptance criteria)
Given the customer doesn't have connectivity
And there’s a cached version of popular movies
And the cache is less than seven days old
When the customer requests to see the popular movies
Then the app should display the latest popular movies saved
Given the customer doesn't have connectivity
And there’s a cached version of the popular movies
And the cache is seven days old or more
When the customer requests to see the popular movies
Then the app should display an error message
Given the customer doesn't have connectivity
And the cache is empty
When the customer requests to see the popular movies
Then the app should display an error message
Use Cases
Load Popular Movies From Remote Use Case
Data:
URL
Primary course (happy path):
Execute "Load Popular Movies" command with above data.
System downloads data from the URL.
System validates downloaded data.
System creates popular movies from valid data.
System delivers popular movies.
Invalid data – error course (sad path):
System delivers invalid data error.
No connectivity – error course (sad path):
System delivers connectivity error.
Load Popular Movies From Cache Use Case
Primary course:
Execute "Load Popular Movies" command with above data.
System retrieves movies data from cache.
System validates cache is less than seven days old.
System creates popular movies from cached data.
System delivers popular movies.
Retrieval error course (sad path):
System delivers error.
Expired cache course (sad path):
System delivers no feed images.
Empty cache course (sad path):
System delivers no feed images.
Validate Popular Movies Cache Use Case
Primary course:
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.
Cache Popular Movies Use Case
Data:
Popular movie
Primary course (happy path):
Execute "Save Popular movie" command with above data.