|
15 | 15 | */ |
16 | 16 | package org.androidannotations.test15.efragment; |
17 | 17 |
|
| 18 | +import static org.fest.assertions.api.Assertions.assertThat; |
| 19 | +import static org.junit.Assert.assertFalse; |
| 20 | +import static org.junit.Assert.assertTrue; |
| 21 | + |
| 22 | +import java.util.concurrent.Executor; |
| 23 | + |
| 24 | +import org.androidannotations.api.BackgroundExecutor; |
| 25 | +import org.androidannotations.test15.R; |
18 | 26 | import org.junit.Before; |
19 | 27 | import org.junit.Test; |
20 | 28 | import org.junit.runner.RunWith; |
|
27 | 35 | import android.support.v4.app.FragmentTransaction; |
28 | 36 | import android.view.View; |
29 | 37 | import android.widget.ListView; |
30 | | -import org.androidannotations.api.BackgroundExecutor; |
31 | | - |
32 | | -import java.util.concurrent.Executor; |
33 | | - |
34 | | -import static org.fest.assertions.api.Assertions.assertThat; |
35 | | -import static org.junit.Assert.assertFalse; |
36 | | -import static org.junit.Assert.assertTrue; |
37 | 38 |
|
38 | 39 | @RunWith(RobolectricTestRunner.class) |
39 | 40 | public class MyListFragmentTest { |
40 | 41 |
|
41 | 42 | private static final int TESTED_CLICKED_INDEX = 4; |
42 | 43 |
|
43 | | - MyListFragment_ myListFragment; |
| 44 | + MyListFragment_ myListFragment; |
44 | 45 | FragmentManager fragmentManager; |
45 | 46 |
|
46 | 47 | @Before |
@@ -110,8 +111,16 @@ public void ignored_when_detached_works_for_ignored_method() { |
110 | 111 | assertFalse(myListFragment.didExecute); |
111 | 112 | } |
112 | 113 |
|
| 114 | + @Test |
| 115 | + public void layout_not_injected_without_force() { |
| 116 | + View buttonInInjectedLayout = myListFragment.getView().findViewById(R.id.conventionButton); |
| 117 | + |
| 118 | + assertThat(buttonInInjectedLayout).isNull(); |
| 119 | + } |
| 120 | + |
113 | 121 | private void runBackgroundsOnSameThread() { |
114 | | - //Simplify the threading by making a dummy executor that runs off the same thread |
| 122 | + // Simplify the threading by making a dummy executor that runs off the |
| 123 | + // same thread |
115 | 124 | BackgroundExecutor.setExecutor(new Executor() { |
116 | 125 | @Override |
117 | 126 | public void execute(Runnable command) { |
|
0 commit comments