Please enable JavaScript.
Coggle requires JavaScript to display documents.
Clean Architecture Practice - Coggle Diagram
Clean Architecture Practice
Login
UI:
Input username
Input password
Touch login button
Case for testing UI
Testing component in UI
Check EditText username, password visible
Check Button login visible
Check Background of EditText is normal
Check Button Login id disabled
Test validate form with empty password
Input valid username
Check button is disabled
Check background of password editText is normal
Test validate form with empty username
Input valid password
Check button Login is disabled
Check background of username editText is normal
Test action login with valid data
Input valid username and password
Check navigate to dashboard
ViewModel:
login function
usernameChange func
passwordChange func
Test validate form
Check password and username valid is not empty
Case:
Input empty username -> expected formValidate = false, usernameState = error message
Input empty pw -> formValidate = flase, pwState = errMsg
Input empty pw and empty username -> formValidate = false, usernameState = errMsg, passwordState = errMsg
Input valid username and password -> formValidate = true, usernameState and pwState = 0
Test login func
Case
Testvalue when login fail -> expected: loadingState = ERROR, check errMsg = mock data
Test value uer when login success -> expected: user = mock data
Test show loading when action login
Test hide loading when finish login
Test should call login function in repo object
Repository:
login func using api
Api will response a user object (username, password, signupstep and avatar) if success. Otherwise return code error
Api login return success, it will save user into shareReference
Case:
Test should call login function of api
Test user result with login success
Test error message with login fail
Test should call local cache save user when api return success
SignUp through 3 steps
user info: username, password, avatar
travel experience: having experience or not, sharing ur experience
Other: resource reference app, user expectation
SignUp user info
Input username, password
Take/Get a photo
Touch Next button
Repository:
sign up func use API and local data
If API response success, it will save user info to local. Otherwise return error
Testing
Verify call the API
Verify save user when API return success
Verify result when sign up success
Verify result when sign up fail
ViewModel:
Using the usecase signupuserInfo
Implement check validate user info
Implement sign up func
Testing validation:
Check validate username with input empty/invalid username
Check validate password with input empty/invalid password
Check validate avatar with empty avatar
Check validate form with invalid username, pw and empty avatar
Check form validate with valid data
Testing signup function
Verify call signup func in usecase
Verify result when usecase return success/fail
Verify show loading indicator
Verify hide loading when usecase response data
UI:
Input username
Input password
Take a photo
Testing
Check component in view visible
Check validate form with empty/invalid username
Check validate form with empty/valid password
Check validate form with empty avatar
Check signup with input valid data
Sign up travel experience
Choose have experience or not
Describe the experience
Repository:
Sign up func use API and local data
If API response success, it will update info of user into local Otherwise return error
UI:
Choose have travel experience or not
Input the experience (not require)
ViewModel
Using the usecase signUpTravelInfo
Implement sign up func
Sign up other info
Choose source reference app
Choose user expectation ( required)
Same sign up travel experience
Show list posts
Show loading indicator
Show list posts, scroll list to end, show loading indicator and continue load data
If load list posts got error, it will show error in the end of list and has button retry
Touch retry button to reload page
Swipe to refresh list
Dao class: get list posts by item id and limit number
Test case:
case data empty -> return empty
case data list size > limit number -> return list size = limit number
case data list size < limit number -> return list size = local data size
Data source:
Using get list post func in repository
Get list posts with first item has id = 0 in init load func
Get list post with continue items in after load func
Retry loading fail
Test case:
Verify repository call the func get list posts
Check state loading value
Verify call the retry loading fail when load data error
Repository:
get list post
(lastItemId) return list posts for per page
It merge data from local and network. Load data from network success, it will save data into local.
Test case:
Verify call local data to get list posts
Verify call remote to get list posts
Verify save data into local when get data from remote success
Check value return when local data return empty and remote return a list
Check value return when local and remote returns a list posts
ViewModel
Load list posts
Load loading state: SUCCESS, ERROR, LOADING
Retry load page fail
Refresh list posts
getPostsUseCase
Use the data source return source livedata