Beagle v1.7 is no longer actively maintained. The documented version you are viewing may contain deprecated functionality. For up-to-date documentation, see the latest version .
Roboletric is a framework for unit testing on Android. One of its functions is to simulate information about Android’s context during the tests performed.
It’s necessary to configure a dependency of Yoga Layout called SoLoader, that, if it’s not enabled as TEST mode, a nullPointerException error will occur, since the view will not exist in that context.
Therefore, the SDK is configured to activate “TesteMode” in SoLoader when starting a test and deactivating it when finished. To do so, just use the functions as indicated below.
To configure Beagle in for robolectric tests, add the code below in your test case:
@BeforeClass
fun setup() {
BeagleSdk.setInTestMode()
}
@AfterClass
fun teardown() {
BeagleSdk.deinitForTest()
}
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.