File tree Expand file tree Collapse file tree
app/src/androidTest/java/org/schabi/newpipe/ui/components/video/comments Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,13 +24,14 @@ class CommentSectionErrorTest {
2424 /* *
2525 * Test Resource.Error state - when initial comment info loading fails
2626 */
27+ class TestNetworkException : NetworkException (" Connection attempt timed out" , null ) {
28+ override fun getErrorCode (): Int = NetworkException .ERROR_CONNECTION_TIMED_OUT
29+ override fun isImmediatelyRetryable () = true
30+ }
2731 @Test
2832 fun testResourceErrorState_ShowsUnableToLoadCommentsUiModel () {
2933
30- val networkException = object : NetworkException (" Connection attempt timed out" , null ) {
31- override fun getErrorCode (): Int = NetworkException .ERROR_CONNECTION_TIMED_OUT
32- override fun isImmediatelyRetryable () = true
33- }
34+ val networkException = TestNetworkException ()
3435 val errorResource = Resource .Error (networkException)
3536 assertEquals(" Should contain the network exception" , networkException, errorResource.throwable)
3637
You can’t perform that action at this time.
0 commit comments