Skip to content

Instantly share code, notes, and snippets.

@TechIsFun
Created November 3, 2020 22:30
Show Gist options
  • Save TechIsFun/bc6c9c8e57572134ee49322c78737e72 to your computer and use it in GitHub Desktop.
Save TechIsFun/bc6c9c8e57572134ee49322c78737e72 to your computer and use it in GitHub Desktop.
Usage of ForceLocaleRule
@RunWith(AndroidJUnit4.class)
public class MyActivityTest {
@ClassRule
public static final ForceLocaleRule localeTestRule = new ForceLocaleRule(Locale.UK);
@Rule
public ActivityTestRule<MyActivity> mMyActivityRule = new ActivityTestRule<>(MyActivity.class);
private Context mContext;
@Before
public void setUp() {
// ...
}
@Test
public void testSomeMethod() {
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment