Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gloriacai01 committed Sep 4, 2024
1 parent cd11f8e commit dea9e43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ abstract class Encoder(name: String) : Component(SUBTYPE, named(name)) {
}





/**
* Return a dictionary of the types of position reporting this encoder supports.
* @return a map of position types to supported status.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ class EncoderTest {

@Test
fun getPosition(){
//test no position type given
`when`(encoder.getPosition(eq(null), any(Struct::class.java) ?: Struct.getDefaultInstance())).thenReturn(23.0f to PositionType.POSITION_TYPE_TICKS_COUNT)
var pos = encoder.getPosition()
verify(encoder).getPosition()
assertEquals(23.0f, pos.first)
assertEquals(PositionType.POSITION_TYPE_TICKS_COUNT, pos.second)

//test position type given
`when`(encoder.getPosition(eq(PositionType.POSITION_TYPE_ANGLE_DEGREES),any(Struct::class.java) ?: Struct.getDefaultInstance())).thenReturn(23.0f to PositionType.POSITION_TYPE_ANGLE_DEGREES)
pos = encoder.getPosition(PositionType.POSITION_TYPE_ANGLE_DEGREES)
verify(encoder).getPosition(PositionType.POSITION_TYPE_ANGLE_DEGREES)
Expand Down

0 comments on commit dea9e43

Please sign in to comment.