Last active
February 8, 2023 13:21
-
-
Save pandelisgreen13/5850882b018db04c992cfe3045722983 to your computer and use it in GitHub Desktop.
Android Studio unit test bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When we run the following test from the Android Studio, the test is successful, but if you run the unit test from the terminal, | |
the test is failing as excpected | |
Steps to reproduce : | |
1) Create the following class | |
2) Use the problematic unit test | |
3) Run the test from android studio and terminal | |
4) It must behave differently | |
class TestMapper { | |
fun testFun(string: String?): String { | |
return "any" | |
} | |
} | |
import org.junit.Assert | |
import org.junit.Test | |
import org.mockito.kotlin.any | |
class TestMapperTest { | |
@Test | |
fun testAny() { | |
val testMapper = TestMapper() | |
val result = testMapper.testFun(any()) | |
Assert.assertEquals("any", result) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment