Skip to content

Commit

Permalink
update coroutines and pass test case
Browse files Browse the repository at this point in the history
  • Loading branch information
waqasakram117 committed Feb 14, 2021
1 parent df35c45 commit 283bc91
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
'retrofit' : '2.6.4',
'okhttp' : '3.14.7',
'junit' : '4.13',
'coroutine': '1.4.0'
'coroutine': '1.4.2'
]
repositories {
mavenCentral()
Expand Down
28 changes: 14 additions & 14 deletions src/test/java/FlowTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class FlowTest {
}

@Test
fun clientErrorTestFlowWithApiResulft() {
fun clientErrorTestFlowWithApiResultResponse() {

server.enqueue(
MockResponse()
Expand All @@ -124,29 +124,29 @@ class FlowTest {
is ApiResult.Success -> {
it.result // This is result
}
is ApiResult.StartRequest -> TODO()
is ApiResult.EndRequest -> TODO()
is ApiResult.EmptyResult -> TODO()
is ApiResult.StartRequest -> {}
is ApiResult.EndRequest -> {}
is ApiResult.EmptyResult -> {}
is ApiResult.Error -> {
when (it) {
is ApiResult.Error.ClientError -> {
when (it) {
is ApiResult.Error.ClientError.UnAuthorized -> TODO()
is ApiResult.Error.ClientError.BadRequest -> TODO()
is ApiResult.Error.ClientError.Forbidden -> TODO()
is ApiResult.Error.ClientError.NotFound -> TODO()
is ApiResult.Error.ClientError.InternetConnection -> TODO()
is ApiResult.Error.ClientError.UnAuthorized -> {}
is ApiResult.Error.ClientError.BadRequest -> {}
is ApiResult.Error.ClientError.Forbidden -> {}
is ApiResult.Error.ClientError.NotFound -> {}
is ApiResult.Error.ClientError.InternetConnection -> {}
}
}
is ApiResult.Error.ServerError -> {
when (it) {
ApiResult.Error.ServerError.Internal -> TODO()
ApiResult.Error.ServerError.RequestNotImplemented -> TODO()
ApiResult.Error.ServerError.BadGateway -> TODO()
ApiResult.Error.ServerError.ServiceUnavailable -> TODO()
ApiResult.Error.ServerError.Internal -> {}
ApiResult.Error.ServerError.RequestNotImplemented -> {}
ApiResult.Error.ServerError.BadGateway -> {}
ApiResult.Error.ServerError.ServiceUnavailable -> {}
}
}
is ApiResult.Error.UnHandled -> TODO()
is ApiResult.Error.UnHandled -> {}
}
}

Expand Down

0 comments on commit 283bc91

Please sign in to comment.