• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.robolectric.shadows;
2 
3 import static com.google.common.truth.Truth.assertThat;
4 
5 import android.content.pm.ResolveInfo;
6 import androidx.test.ext.junit.runners.AndroidJUnit4;
7 import org.junit.Before;
8 import org.junit.Test;
9 import org.junit.runner.RunWith;
10 
11 @RunWith(AndroidJUnit4.class)
12 public class ShadowResolveInfoTest {
13 
14   private ResolveInfo mResolveInfo;
15 
16   @Before
setup()17   public void setup() {
18     mResolveInfo = ShadowResolveInfo.newResolveInfo("name", "package", "fragmentActivity");
19   }
20 
21   @Test
testNewResolveInfoWithActivity()22   public void testNewResolveInfoWithActivity() {
23     assertThat(mResolveInfo.loadLabel(null).toString()).isEqualTo("name");
24     assertThat(mResolveInfo.activityInfo.packageName).isEqualTo("package");
25     assertThat(mResolveInfo.activityInfo.applicationInfo.packageName).isEqualTo("package");
26     assertThat(mResolveInfo.activityInfo.name).isEqualTo("fragmentActivity");
27   }
28 }
29