androidx.fragment.app.testing.FragmentScenario Java Examples
The following examples show how to use
androidx.fragment.app.testing.FragmentScenario.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BuilderUnitTest.java From MaterialTapTargetPrompt with Apache License 2.0 | 6 votes |
@Test public void testBuilder_Fragment() { FragmentScenario<EmptyTestFragment> scenario = FragmentScenario.launchInContainer(EmptyTestFragment.class); scenario.onFragment(fragment -> { final MaterialTapTargetPrompt.Builder builder = new MaterialTapTargetPrompt.Builder(fragment); assertTrue(builder.getResourceFinder() instanceof SupportFragmentResourceFinder); }); }
Example #2
Source File: BuilderUnitTest.java From MaterialTapTargetPrompt with Apache License 2.0 | 5 votes |
@Test public void testBuilder_Fragment_Resource() { FragmentScenario<EmptyTestFragment> scenario = FragmentScenario.launchInContainer(EmptyTestFragment.class); scenario.onFragment(fragment -> { final MaterialTapTargetPrompt.Builder builder = new MaterialTapTargetPrompt.Builder(fragment, 0); assertTrue(builder.getResourceFinder() instanceof SupportFragmentResourceFinder); }); }
Example #3
Source File: BuilderUnitTest.java From MaterialTapTargetPrompt with Apache License 2.0 | 5 votes |
@Test public void testBuilder_DialogFragment() { FragmentScenario<EmptyTestDialogFragment> scenario = FragmentScenario.launchInContainer(EmptyTestDialogFragment.class); scenario.onFragment(fragment -> { final MaterialTapTargetPrompt.Builder builder = new MaterialTapTargetPrompt.Builder(fragment); assertTrue(builder.getResourceFinder() instanceof SupportFragmentResourceFinder); }); }
Example #4
Source File: SupportFragmentLoggerTest.java From lightcycle with Apache License 2.0 | 5 votes |
@Before public void setUp() { controller = FragmentScenario.launchInContainer(SampleSupportFragment.class); controller.onFragment(fragment -> { supportFragmentLogger = ((SampleSupportFragment) fragment).supportFragmentLogger; } ); }
Example #5
Source File: ChromeCustomTabsTest.java From browser-switch-android with MIT License | 4 votes |
@Before public void beforeEach() { scenario = FragmentScenario.launch(TestBrowserSwitchFragment.class); }
Example #6
Source File: FragmentController.java From easypermissions with Apache License 2.0 | 4 votes |
public FragmentController(Class<T> clazz) { scenario = FragmentScenario.launch(clazz); }