Skip to content

Commit

Permalink
Remove unused Exception from ActivityTest
Browse files Browse the repository at this point in the history
Signed-off-by: utzcoz <utzcoz@outlook.com>
  • Loading branch information
utzcoz committed Apr 3, 2022
1 parent b2c3daf commit 4d62200
Showing 1 changed file with 5 additions and 9 deletions.
Expand Up @@ -33,17 +33,16 @@ public void setUp() throws Exception {
}

@Test
public void whenSetOnActivityInManifest_activityGetsThemeFromActivityInManifest()
throws Exception {
public void whenSetOnActivityInManifest_activityGetsThemeFromActivityInManifest() {
Activity activity = activityWithAnotherThemeRule.launchActivity(null);
Button theButton = activity.findViewById(R.id.button);
ColorDrawable background = (ColorDrawable) theButton.getBackground();
assertThat(background.getColor()).isEqualTo(0xffff0000);
}

@Test
public void whenExplicitlySetOnActivity_afterSetContentView_activityGetsThemeFromActivityInManifest()
throws Exception {
public void
whenExplicitlySetOnActivity_afterSetContentView_activityGetsThemeFromActivityInManifest() {
Activity activity = activityWithAnotherThemeRule.launchActivity(null);
activity.setTheme(R.style.Theme_Robolectric);
Button theButton = activity.findViewById(R.id.button);
Expand All @@ -52,8 +51,7 @@ public void whenExplicitlySetOnActivity_afterSetContentView_activityGetsThemeFro
}

@Test
public void whenExplicitlySetOnActivity_beforeSetContentView_activityUsesNewTheme()
throws Exception {
public void whenExplicitlySetOnActivity_beforeSetContentView_activityUsesNewTheme() {
ActivityWithAnotherTheme.setThemeBeforeContentView = R.style.Theme_Robolectric;
Activity activity = activityWithAnotherThemeRule.launchActivity(null);
Button theButton = activity.findViewById(R.id.button);
Expand All @@ -62,12 +60,10 @@ public void whenExplicitlySetOnActivity_beforeSetContentView_activityUsesNewThem
}

@Test
public void whenNotSetOnActivityInManifest_activityGetsThemeFromApplicationInManifest()
throws Exception {
public void whenNotSetOnActivityInManifest_activityGetsThemeFromApplicationInManifest() {
Activity activity = activityWithoutThemeRule.launchActivity(null);
Button theButton = activity.findViewById(R.id.button);
ColorDrawable background = (ColorDrawable) theButton.getBackground();
assertThat(background.getColor()).isEqualTo(0xff00ff00);
}

}

0 comments on commit 4d62200

Please sign in to comment.