Android newbie here! I have an Activity class I'll call SomeActivity
, which uses a theme BlueTheme
:
<style name=“BlueTheme” parent="@style/AnotherTheme”>
…
</style>
How can I verify that my activity is using the theme in a test? Activity has a getTheme
method, but I'm struggling to find some way to identify which theme it is.
@Test
public void verifyTheme() {
SomeActivity activity = setUpActivityControllerAndGetActivity();
// This represents what I would like to do, but don’t know how
String actualThemeName = activity.getTheme().getThemeName();
assertThat(actualThemeName).isEqualTo(“BlueTheme”);
}