Skip to content

Commit

Permalink
Improve CacheNetworkResponseTest to verify response code. (#2829)
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrtwhite authored Feb 4, 2025
1 parent f27e9ca commit 986e7fe
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class CacheNetworkResponseTest {
@Test
fun canSerializeAndDeserializeCacheResponse() = runTestAsync {
val expected = NetworkResponse(
code = 301,
requestMillis = 1701673257L,
responseMillis = 1701674491L,
headers = NetworkHeaders.Builder()
Expand All @@ -22,9 +23,7 @@ class CacheNetworkResponseTest {
CacheNetworkResponse.writeTo(expected, buffer)
val actual = CacheNetworkResponse.readFrom(buffer)

assertEquals(expected.requestMillis, actual.requestMillis)
assertEquals(expected.responseMillis, actual.responseMillis)
assertEquals(expected.headers, actual.headers)
assertEquals(expected, actual)
}

/** Regression test: https://github.com/coil-kt/coil/issues/1467 */
Expand All @@ -33,6 +32,7 @@ class CacheNetworkResponseTest {
val headerName = "name"
val headerValue = "微信图片"
val expected = NetworkResponse(
code = 500,
requestMillis = 1701673257L,
responseMillis = 1701674491L,
headers = NetworkHeaders.Builder()
Expand Down

0 comments on commit 986e7fe

Please sign in to comment.