Skip to content

Commit

Permalink
fix(CargoMessage): Promote Companion.Type to Type
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarea committed Jul 20, 2020
1 parent f246d1e commit 0680ad4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ class CargoMessage(val message: ByteArray) {
}
}

companion object {
enum class Type(internal val formatSignature: List<Byte>) {
PARCEL(PARCEL_SERIALIZER.formatSignature.asList()),
PCA(ParcelCollectionAck.FORMAT_SIGNATURE.asList())
}
enum class Type(internal val formatSignature: List<Byte>) {
PARCEL(PARCEL_SERIALIZER.formatSignature.asList()),
PCA(ParcelCollectionAck.FORMAT_SIGNATURE.asList())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ internal class CargoMessageSetTest {
val cargoMessages = cargoMessageSet.classifyMessages().asSequence().toList()

assertEquals(2, cargoMessages.size)
assertEquals(CargoMessage.Companion.Type.PARCEL, cargoMessages[0].type)
assertEquals(CargoMessage.Type.PARCEL, cargoMessages[0].type)
assertEquals(parcelSerialized.asList(), cargoMessages[0].message.asList())
assertEquals(CargoMessage.Companion.Type.PCA, cargoMessages[1].type)
assertEquals(CargoMessage.Type.PCA, cargoMessages[1].type)
assertEquals(pcaSerialized.asList(), cargoMessages[1].message.asList())
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CargoMessageTest {

val cargoMessage = CargoMessage(parcelSerialized)

assertEquals(CargoMessage.Companion.Type.PARCEL, cargoMessage.type)
assertEquals(CargoMessage.Type.PARCEL, cargoMessage.type)
}

@Test
Expand All @@ -31,7 +31,7 @@ class CargoMessageTest {

val cargoMessage = CargoMessage(pcaSerialized)

assertEquals(CargoMessage.Companion.Type.PCA, cargoMessage.type)
assertEquals(CargoMessage.Type.PCA, cargoMessage.type)
}

@Test
Expand Down

0 comments on commit 0680ad4

Please sign in to comment.