mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Migrated media/zoomControllers package to kotlin (#6204)
* Rename .java to .kt * Migrated media/zoomControllers package to kotlin --------- Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
This commit is contained in:
parent
972bf785f1
commit
30322707fc
24 changed files with 1959 additions and 2130 deletions
|
|
@ -107,43 +107,43 @@ class MultiPointerGestureDetectorUnitTest {
|
|||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testIsGestureInProgress() {
|
||||
Assert.assertEquals(detector.isGestureInProgress, false)
|
||||
Assert.assertEquals(detector.isGestureInProgress(), false)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testGetNewPointerCount() {
|
||||
Assert.assertEquals(detector.newPointerCount, 0)
|
||||
Assert.assertEquals(detector.getNewPointerCount(), 0)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testGetPointerCount() {
|
||||
Assert.assertEquals(detector.pointerCount, 0)
|
||||
Assert.assertEquals(detector.getPointerCount(), 0)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testGetStartX() {
|
||||
Assert.assertEquals(detector.startX[0], 0.0f)
|
||||
Assert.assertEquals(detector.getStartX()[0], 0.0f)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testGetStartY() {
|
||||
Assert.assertEquals(detector.startY[0], 0.0f)
|
||||
Assert.assertEquals(detector.getStartY()[0], 0.0f)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testGetCurrentX() {
|
||||
Assert.assertEquals(detector.currentX[0], 0.0f)
|
||||
Assert.assertEquals(detector.getCurrentX()[0], 0.0f)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testGetCurrentY() {
|
||||
Assert.assertEquals(detector.currentY[0], 0.0f)
|
||||
Assert.assertEquals(detector.getCurrentY()[0], 0.0f)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -84,51 +84,51 @@ class TransformGestureDetectorUnitTest {
|
|||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testIsGestureInProgress() {
|
||||
Assert.assertEquals(detector.isGestureInProgress, false)
|
||||
Assert.assertEquals(detector.isGestureInProgress(), false)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testGetNewPointerCount() {
|
||||
Assert.assertEquals(detector.newPointerCount, 0)
|
||||
Assert.assertEquals(detector.getNewPointerCount(), 0)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testGetPointerCount() {
|
||||
Assert.assertEquals(detector.pointerCount, 0)
|
||||
Assert.assertEquals(detector.getPointerCount(), 0)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testGetPivotX() {
|
||||
Assert.assertEquals(detector.pivotX, 0.0f)
|
||||
Assert.assertEquals(detector.getPivotX(), 0.0f)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testGetPivotY() {
|
||||
Assert.assertEquals(detector.pivotY, 0.0f)
|
||||
Assert.assertEquals(detector.getPivotY(), 0.0f)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testGetTranslationX() {
|
||||
Assert.assertEquals(detector.translationX, 0.0f)
|
||||
Assert.assertEquals(detector.getTranslationX(), 0.0f)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testGetTranslationY() {
|
||||
Assert.assertEquals(detector.translationY, 0.0f)
|
||||
Assert.assertEquals(detector.getTranslationY(), 0.0f)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testGetScaleCaseLessThan2() {
|
||||
Whitebox.setInternalState(detector, "mDetector", mDetector)
|
||||
whenever(mDetector.pointerCount).thenReturn(1)
|
||||
Assert.assertEquals(detector.scale, 1f)
|
||||
whenever(mDetector.getPointerCount()).thenReturn(1)
|
||||
Assert.assertEquals(detector.getScale(), 1f)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -138,20 +138,20 @@ class TransformGestureDetectorUnitTest {
|
|||
array[0] = 0.0f
|
||||
array[1] = 1.0f
|
||||
Whitebox.setInternalState(detector, "mDetector", mDetector)
|
||||
whenever(mDetector.pointerCount).thenReturn(2)
|
||||
whenever(mDetector.startX).thenReturn(array)
|
||||
whenever(mDetector.startY).thenReturn(array)
|
||||
whenever(mDetector.currentX).thenReturn(array)
|
||||
whenever(mDetector.currentY).thenReturn(array)
|
||||
Assert.assertEquals(detector.scale, 1f)
|
||||
whenever(mDetector.getPointerCount()).thenReturn(2)
|
||||
whenever(mDetector.getStartX()).thenReturn(array)
|
||||
whenever(mDetector.getStartY()).thenReturn(array)
|
||||
whenever(mDetector.getCurrentX()).thenReturn(array)
|
||||
whenever(mDetector.getCurrentY()).thenReturn(array)
|
||||
Assert.assertEquals(detector.getScale(), 1f)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testGetRotationCaseLessThan2() {
|
||||
Whitebox.setInternalState(detector, "mDetector", mDetector)
|
||||
whenever(mDetector.pointerCount).thenReturn(1)
|
||||
Assert.assertEquals(detector.rotation, 0f)
|
||||
whenever(mDetector.getPointerCount()).thenReturn(1)
|
||||
Assert.assertEquals(detector.getRotation(), 0f)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -161,12 +161,12 @@ class TransformGestureDetectorUnitTest {
|
|||
array[0] = 0.0f
|
||||
array[1] = 1.0f
|
||||
Whitebox.setInternalState(detector, "mDetector", mDetector)
|
||||
whenever(mDetector.pointerCount).thenReturn(2)
|
||||
whenever(mDetector.startX).thenReturn(array)
|
||||
whenever(mDetector.startY).thenReturn(array)
|
||||
whenever(mDetector.currentX).thenReturn(array)
|
||||
whenever(mDetector.currentY).thenReturn(array)
|
||||
Assert.assertEquals(detector.rotation, 0f)
|
||||
whenever(mDetector.getPointerCount()).thenReturn(2)
|
||||
whenever(mDetector.getStartX()).thenReturn(array)
|
||||
whenever(mDetector.getStartY()).thenReturn(array)
|
||||
whenever(mDetector.getCurrentX()).thenReturn(array)
|
||||
whenever(mDetector.getCurrentY()).thenReturn(array)
|
||||
Assert.assertEquals(detector.getRotation(), 0f)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue