How do I get access to resources in my test classes when using robolectric
You can access your app's resources via your Application instance. Use ApplicationProvider to fetch it from within a unit test:
// replace 'Application' with your actual class if you use a custom one
ApplicationProvider.getApplicationContext<Application>().resources
Ensure includeAndroidResources is set to true in your build.gradle
or your unit tests won't see your resources:
android {
testOptions.unitTests.includeAndroidResources true
}